summaryrefslogtreecommitdiffhomepage
path: root/src/numeric.c
diff options
context:
space:
mode:
authorFlavio Medeiros <[email protected]>2017-09-02 13:25:09 -0300
committerFlavio Medeiros <[email protected]>2017-09-02 13:25:09 -0300
commit9f677b72dbbfe609cc5c0fdd3dcb0437e99fbcf9 (patch)
tree04010f77abda696bdf2bd98a5dd1143b861fac9b /src/numeric.c
parent476af3c64726fed823e4a1fdc316f0780f340246 (diff)
downloadmruby-9f677b72dbbfe609cc5c0fdd3dcb0437e99fbcf9.tar.gz
mruby-9f677b72dbbfe609cc5c0fdd3dcb0437e99fbcf9.zip
Trying to make the source code more understandable by removing mixing of ternary if statements with attributions.
Diffstat (limited to 'src/numeric.c')
-rw-r--r--src/numeric.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/numeric.c b/src/numeric.c
index 999f4aa61..afb8415a0 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -380,7 +380,11 @@ flo_shift(mrb_state *mrb, mrb_value x, mrb_int width)
#if defined(_ISOC99_SOURCE)
val = trunc(val);
#else
- val = val > 0 ? floor(val) : ceil(val);
+ if (val > 0){
+ val = floor(val);
+ } else {
+ val = ceil(val);
+ }
#endif
if (val == 0 && mrb_float(x) < 0) {
return mrb_fixnum_value(-1);