Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Testing latest pari + WASM + node.js... and it works?! Wow.

28495 views
License: GPL3
ubuntu2004
1
#include <stdio.h>
2
3
#ifdef _WIN64
4
#define long long long
5
#endif
6
7
int main()
8
{
9
if (sizeof(long) == 4)
10
{
11
union {double d; unsigned long l[2];} x;
12
x.d = 2.;
13
if (x.l[0]==0 && x.l[1]==(1UL<<30)) printf("1\n");
14
else if (x.l[1]==0 && x.l[0]==(1UL<<30)) printf("0\n");
15
else
16
printf("NOT IEEE (32 bit)\n");
17
}
18
else
19
{
20
union {double d; unsigned long l;} x;
21
x.d = 2.;
22
if (x.l==((unsigned long)1)<<62) printf("-\n");
23
else
24
printf("NOT IEEE (64 bit)\n");
25
}
26
return 0;
27
}
28
29