Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Side by Side Diff: fusl/src/math/ceilf.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include "libm.h" 1 #include "libm.h"
2 2
3 float ceilf(float x) 3 float ceilf(float x) {
4 { 4 union {
5 » union {float f; uint32_t i;} u = {x}; 5 float f;
6 » int e = (int)(u.i >> 23 & 0xff) - 0x7f; 6 uint32_t i;
7 » uint32_t m; 7 } u = {x};
8 int e = (int)(u.i >> 23 & 0xff) - 0x7f;
9 uint32_t m;
8 10
9 » if (e >= 23) 11 if (e >= 23)
10 » » return x; 12 return x;
11 » if (e >= 0) { 13 if (e >= 0) {
12 » » m = 0x007fffff >> e; 14 m = 0x007fffff >> e;
13 » » if ((u.i & m) == 0) 15 if ((u.i & m) == 0)
14 » » » return x; 16 return x;
15 » » FORCE_EVAL(x + 0x1p120f); 17 FORCE_EVAL(x + 0x1p120f);
16 » » if (u.i >> 31 == 0) 18 if (u.i >> 31 == 0)
17 » » » u.i += m; 19 u.i += m;
18 » » u.i &= ~m; 20 u.i &= ~m;
19 » } else { 21 } else {
20 » » FORCE_EVAL(x + 0x1p120f); 22 FORCE_EVAL(x + 0x1p120f);
21 » » if (u.i >> 31) 23 if (u.i >> 31)
22 » » » u.f = -0.0; 24 u.f = -0.0;
23 » » else if (u.i << 1) 25 else if (u.i << 1)
24 » » » u.f = 1.0; 26 u.f = 1.0;
25 » } 27 }
26 » return u.f; 28 return u.f;
27 } 29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698