Movement against float.init being nan
Walter Bright
newshound2 at digitalmars.com
Tue Aug 23 22:33:49 UTC 2022
On 8/23/2022 1:44 PM, Dave P. wrote:
> What’s great is that structs defined in C imported in D and structs defined in D
> imported in D will have completely different initial values despite being
> syntactically identical!
Let's have some fun with the following C program:
-----------
#include <stdio.h>
struct Foo { float x; };
int main()
{
struct Foo f;
printf("%g\n", f.x);
}
gcc test.c
./a.out
2.12133e-15
-------------
Oh well!
More information about the Digitalmars-d
mailing list