FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
binaryen/test/float_ops.cpp at waitqueue-api · WebAssembly/binaryen · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
WebAssembly
/
binaryen
Public
Notifications
You must be signed in to change notification settings
Fork
881
Star
8.6k
Code
Issues
339
Pull requests
221
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
binaryen
/
test
/
float_ops.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
73 lines (61 loc) · 1.87 KB
Breadcrumbs
binaryen
/
test
/
float_ops.cpp
Copy path
File metadata and controls
73 lines (61 loc) · 1.87 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
include
<
algorithm
>
#
include
<
cmath
>
#
include
<
emscripten.h
>
extern
"
C
"
{
//
unary
double
EMSCRIPTEN_KEEPALIVE
dneg
(
double
x) {
return
-x; }
double
EMSCRIPTEN_KEEPALIVE
dfloor
(
double
x) {
return
floor
(x); }
//
binary
double
EMSCRIPTEN_KEEPALIVE
dadd
(
double
x,
double
y) {
return
x + y; }
double
EMSCRIPTEN_KEEPALIVE
dsub
(
double
x,
double
y) {
return
x - y; }
double
EMSCRIPTEN_KEEPALIVE
dmul
(
double
x,
double
y) {
return
x * y; }
double
EMSCRIPTEN_KEEPALIVE
ddiv
(
double
x,
double
y) {
return
x / y; }
double
EMSCRIPTEN_KEEPALIVE
dcopysign
(
double
x,
double
y) {
return
std::copysign
(x, y);
}
double
EMSCRIPTEN_KEEPALIVE
dmin
(
double
x,
double
y) {
return
std::min
(x, y); }
double
EMSCRIPTEN_KEEPALIVE
dmax
(
double
x,
double
y) {
return
std::max
(x, y); }
//
comparisons
int
EMSCRIPTEN_KEEPALIVE
deq
(
double
x,
double
y) {
return
x == y; }
int
EMSCRIPTEN_KEEPALIVE
dne
(
double
x,
double
y) {
return
x != y; }
int
EMSCRIPTEN_KEEPALIVE
dlt
(
double
x,
double
y) {
return
x < y; }
int
EMSCRIPTEN_KEEPALIVE
dle
(
double
x,
double
y) {
return
x <= y; }
int
EMSCRIPTEN_KEEPALIVE
dgt
(
double
x,
double
y) {
return
x > y; }
int
EMSCRIPTEN_KEEPALIVE
dge
(
double
x,
double
y) {
return
x >= y; }
double
EMSCRIPTEN_KEEPALIVE
int_to_double
(
int
x) {
double
d = x;
return
d +
1.23
;
}
double
EMSCRIPTEN_KEEPALIVE
uint_to_double
(
unsigned
x) {
double
d = x;
return
d +
1.23
;
}
int
EMSCRIPTEN_KEEPALIVE
double_to_int
(
double
d) {
d +=
1.23
;
int
x = d;
return
x;
}
int
EMSCRIPTEN_KEEPALIVE
double_to_uint
(
double
d) {
d +=
1.23
;
unsigned
x = d;
return
x;
}
float
EMSCRIPTEN_KEEPALIVE
int_to_float
(
int
x) {
float
d = x;
return
d +
1.23
;
}
float
EMSCRIPTEN_KEEPALIVE
uint_to_float
(
unsigned
x) {
float
d = x;
return
d +
1.23
;
}
int
EMSCRIPTEN_KEEPALIVE
float_to_int
(
float
d) {
d +=
1.23
;
int
x = d;
return
x;
}
int
EMSCRIPTEN_KEEPALIVE
float_to_uint
(
float
d) {
d +=
1.23
;
unsigned
x = d;
return
x;
}
}
Back
|
FazBrowse Home
|
New Git URL