Category talk:Wren-big: Difference between revisions
→Source code: Added BigRat.roundUp method.
m (Now using internal links to related pages.) |
(→Source code: Added BigRat.roundUp method.) |
||
Line 1,810:
// Rounding methods (similar to those in Num class).
ceil { // higher integer, towards zero
if (isInteger) return this.copy()
var div = _n/_d
Line 1,835:
return (this + BigRat.half).floor
}
roundUp { this >= 0 ? ceil : floor } // rounds to higher integer, away from zero
round(digits) { // rounds to 'digits' decimal places
|