Implicit type conversion: Difference between revisions

m
→‎{{header|Perl 6}}: update to ease automated testing
(Added Idris task)
m (→‎{{header|Perl 6}}: update to ease automated testing)
Line 669:
(A normal Rat number has a denominator that is limited to 64 bits, with underflow to floating point to prevent performance degradation; a FatRat, in contrast, has an unlimited denominator size, and can chew up all your memory if you're not careful.)
 
<lang perl6>$x = (-1).sqrt; saymy $x, ' ', $x.WHAT; # NaN (Num)
$x = (-1).sqrt; say $x, ' ', $x.WHAT; # NaN (Num)
$x = (-1).Complex.sqrt; say $x, ' ', $x.WHAT; # 6.12323399573677e-17+1i (Complex)
 
10,327

edits