mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Trying to make the source code more understandable by removing mixing of ternary if statements with attributions.
This commit is contained in:
+5
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user