Ask HN: How do I pivot into SWE from being a stay-at-home dad?
20 pointsby jacobmartin9 comments
#include <math.h>
#include <fenv.h>
#include <stdio.h>
int main(void)
{
double a = sin(INFINITY);
printf("%d\n", fetestexcept(FE_INVALID));
return 0;
} gcc fp.c -o fp printf("%f\n", 57.0 / 100.0 * 100.0);
To my surprise this correctly gave 57.000000, but in python, 57 / 100 * 100
Gave 56.999... anybody know what was up here? Different algorithms for printing fp?
And testing just now, I can't even trigger SIGFPE with division by zero (integer or float). I guess all of these exceptions are "caught" now.