Category talk:Wren-complex: Difference between revisions

Content added Content deleted
(Added description and source code for new 'Wren-complex' module.)
 
(→‎Source code: Added methods to test for integerness.)
Line 151: Line 151:
isInfinity { _real.isInfinity || _imag.isInfinty } // true if either part is infinite
isInfinity { _real.isInfinity || _imag.isInfinty } // true if either part is infinite
isNan { _real.isNan || imag.isNan } // true if either part is nan
isNan { _real.isNan || imag.isNan } // true if either part is nan

// Returns whether real component is an integer and imaginary component is zero.
isRealInteger { _real.isInteger && _imag == 0 }

// Returns whether imaginary component is an integer and real component is zero.
isImagInteger { _imag.isInteger && _real == 0 }


// Returns the ordered pair [_real, _imag].
// Returns the ordered pair [_real, _imag].