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

Unified Diff: fusl/src/math/scalbnf.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 side-by-side diff with in-line comments
Download patch
Index: fusl/src/math/scalbnf.c
diff --git a/fusl/src/math/scalbnf.c b/fusl/src/math/scalbnf.c
index 0b62c3c71f85d4b72a21a9b39752fb77ce0caf10..473792d9899af7a92292d2b8fa129927ed8219e1 100644
--- a/fusl/src/math/scalbnf.c
+++ b/fusl/src/math/scalbnf.c
@@ -1,31 +1,33 @@
#include <math.h>
#include <stdint.h>
-float scalbnf(float x, int n)
-{
- union {float f; uint32_t i;} u;
- float_t y = x;
+float scalbnf(float x, int n) {
+ union {
+ float f;
+ uint32_t i;
+ } u;
+ float_t y = x;
- if (n > 127) {
- y *= 0x1p127f;
- n -= 127;
- if (n > 127) {
- y *= 0x1p127f;
- n -= 127;
- if (n > 127)
- n = 127;
- }
- } else if (n < -126) {
- y *= 0x1p-126f;
- n += 126;
- if (n < -126) {
- y *= 0x1p-126f;
- n += 126;
- if (n < -126)
- n = -126;
- }
- }
- u.i = (uint32_t)(0x7f+n)<<23;
- x = y * u.f;
- return x;
+ if (n > 127) {
+ y *= 0x1p127f;
+ n -= 127;
+ if (n > 127) {
+ y *= 0x1p127f;
+ n -= 127;
+ if (n > 127)
+ n = 127;
+ }
+ } else if (n < -126) {
+ y *= 0x1p-126f;
+ n += 126;
+ if (n < -126) {
+ y *= 0x1p-126f;
+ n += 126;
+ if (n < -126)
+ n = -126;
+ }
+ }
+ u.i = (uint32_t)(0x7f + n) << 23;
+ x = y * u.f;
+ return x;
}

Powered by Google App Engine
This is Rietveld 408576698