17 lines
422 B
C
17 lines
422 B
C
|
#include <float.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
|
#define PRINT(var, format) printf(#var " = " format "\n", var)
|
||
|
|
||
|
// https://en.cppreference.com/w/c/language/arithmetic_types#Real_floating_types
|
||
|
// https://en.cppreference.com/w/c/types/limits#Limits_of_floating-point_types
|
||
|
int main(void) {
|
||
|
PRINT(FLT_EPSILON, "%.9g");
|
||
|
PRINT(DBL_EPSILON, "%.16lg");
|
||
|
|
||
|
PRINT(FLT_MAX, "%.8g");
|
||
|
PRINT(DBL_MAX, "%.17lg");
|
||
|
|
||
|
return 0;
|
||
|
}
|