Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/test/core/closebitcasts.c
4150 views
1
/*
2
* Copyright 2013 The Emscripten Authors. All rights reserved.
3
* Emscripten is available under two separate licenses, the MIT license and the
4
* University of Illinois/NCSA Open Source License. Both these licenses can be
5
* found in the LICENSE file.
6
*/
7
8
#include <stdio.h>
9
10
int main(int argc, char **argv) {
11
float x = argc%17, y = (argc+1)*(argc+2)*(argc+3)*(argc+4)*(argc*5);
12
y *= 1<<30;
13
y *= -13;
14
if (argc == 17) { x++; y--; }
15
int *xi = (int*)&x;
16
int *yi = (int*)&y;
17
int z = *xi - *yi;
18
while (z % 15) {
19
z++;
20
}
21
printf("!%d\n", z);
22
23
double xd = x, yd = y;
24
yd = yd*yd;
25
yd = yd*yd;
26
int *xl = (int*)&xd;
27
int *xh = &((int*)&xd)[1];
28
int *yl = (int*)&yd;
29
int *yh = &((int*)&yd)[1];
30
int l = *xl - *yl;
31
int h = *xh - *yh;
32
while (l % 15) {
33
l++;
34
h += 3;
35
}
36
printf("%d,%d!\n", l, h);
37
return 0;
38
}
39
40
41