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.new("0")].each do |n|
printf "%10s: ** -> %s\n" % [n.class, n**n]
end</lang>
{{out}}
<pre>
FixnumInteger: ** -> 1
Float: ** -> 1.0
Complex: ** -> 1+0i
Rational: ** -> 1/1
BigDecimal: ** -> 0.1E11e1
</pre>
 
1,149

edits