Category talk:Wren-big: Difference between revisions
→Source code: Rewrote BigRat.toFloat and toMixedString methods which were buggy previously.
(→Source code: Fixed bug and aligned BigRat.pow with Rat.pow method.) |
(→Source code: Rewrote BigRat.toFloat and toMixedString methods which were buggy previously.) |
||
Line 2,014:
// Converts the current instance to a Num where possible.
// Will probably lose accuracy if the numerator and/or denominator are not 'small'.
toFloat {
// Converts the current instance to an integer where possible with any fractional part truncated.
Line 2,072:
// Returns a string represenation of this instance in the form "i_n/d" where 'i' is an integer.
toMixedString {
var
var
return sign + q.toString + "_" + r.toString + "/" + _d.toString
}
|