Zero to the zero power: Difference between revisions
→{{header|Ruby}}: BigDecimal.new and Fixnum no longer valid Ruby
(→{{header|BQN}}: Note that it's implementation-defined) |
(→{{header|Ruby}}: BigDecimal.new and Fixnum no longer valid Ruby) |
||
Line 1,437:
<lang ruby>require 'bigdecimal'
[0, 0.0, Complex(0), Rational(0), BigDecimal
printf "%10s: ** -> %s\n" % [n.class, n**n]
end</lang>
{{out}}
<pre>
Float: ** -> 1.0
Complex: ** -> 1+0i
Rational: ** -> 1/1
BigDecimal: ** -> 0.
</pre>
|