obliczenia_naukowe/l1/values.c

17 lines
422 B
C
Raw Normal View History

2024-10-27 21:56:24 +01:00
#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;
}