Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Uncle Bob and Silver Bullets (2017). Parent comment
I get the same output using the following (I switched to the portable memcpy solution.)
#include <stdio.h> #include <float.h> #include <math.h> int main() { int a = 0x361dc5df; // 2.351e-6f int b = 0x361e3e22; // 2.358e-6f; float fa, fb; memcpy(&fa, &a, 4); memcpy(&fb, &b, 4); printf("value-equals? %d\n", fa == fb); printf("fabs-equals? %d\n", fabs(fa-fb)<FLT_EPSILON); }
There are no comments on this comment yet.
I get the same output using the following (I switched to the portable memcpy solution.)
Since FLT_EPSILON is 1.19209290E-07F , I would expect a lot of small, close numbers to give the same output, even without touching subnormal values.