repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
don't reject unknown/future flags in sigaltstack, allow SS_AUTODISARM
[musl.git]
/
src
/
math
/
ceilf.c
blob
869835f39783835b9c2fdda05c16d1e4e4ee6883
1
#include
"libm.h"
2
3
float
ceilf
(
float
x
)
4
{
5
union
{
float
f
;
uint32_t
i
;}
u
= {
x
};
6
int
e
= (
int
)(
u
.
i
>>
23
&
0xff
) -
0x7f
;
7
uint32_t
m
;
8
9
if
(
e
>=
23
)
10
return
x
;
11
if
(
e
>=
0
) {
12
m
=
0x007fffff
>>
e
;
13
if
((
u
.
i
&
m
) ==
0
)
14
return
x
;
15
FORCE_EVAL
(
x
+
0x1
p
120
f
);
16
if
(
u
.
i
>>
31
==
0
)
17
u
.
i
+=
m
;
18
u
.
i
&= ~
m
;
19
}
else
{
20
FORCE_EVAL
(
x
+
0x1
p
120
f
);
21
if
(
u
.
i
>>
31
)
22
u
.
f
= -
0.0
;
23
else if
(
u
.
i
<<
1
)
24
u
.
f
=
1.0
;
25
}
26
return
u
.
f
;
27
}