Trying to make the source code more understandable by removing mixing of ternary if statements with attributions.

This commit is contained in:
Flavio Medeiros
2017-09-02 13:25:09 -03:00
parent 476af3c647
commit 9f677b72db
+5 -1
View File
@@ -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);