e$B1sF#$G$9!#e(B
BigDecimal
e$B$N%F%9%H$r=q$$$F$$$F!"$$$/$D$+5$$K$J$k5sF0$,$"$j$^$7$?!#e(B
- Infinity e$B$Ne(B n e$B>h$,>o$Ke(B NaN
e$B$K$J$k$N$O0U?^E*$G$7$g$&$+!#e(B
ruby19 -rbigdecimal -e ‘x = BigDecimal(“Infinity”); p [x1, x0,
x**-1]’
[#BigDecimal:8261238,‘NaN’,4(8), #BigDecimal:8261224,‘NaN’,4(8),
#BigDecimal:8261210,‘NaN’,4(8)]
inf ** 0 e$B$,e(B NaN e$B$K$J$k$N$ODj5A<!Bh$@$H;W$$$^$9$,!"e(B** 1
e$B$He(B ** -1 e$B$Oe(B
e$B$=$l$>$le(B inf e$B$He(B 0 e$B$r4|BT$7$F$$$^$7$?!#e(B
Float e$B$@$H0J2<$N$h$&$K$J$j$^$9e(B (e$B$&$A$N4D6-$N>l9ge(B) e$B!#e(B
$ ruby19 -e ‘x = 1.0/0.0; p [x1, x0, x**-1]’
[Infinity, 1.0, 0.0]
- 1E1000…(0 e$B$,$$$C$Q$$e(B)…000 e$B$re(B BigDecimal
e$B$KM?$($k$He(B 0 e$B$,JV$k$N$O0U?^E*e(B
e$B$G$7$g$&$+!#e(B
$ ruby19 -rbigdecimal -e ‘p BigDecimal(“1E1” + “0” * 10000)’
#BigDecimal:826133c,‘0.0’,4(8)
Float e$B$@$He(B Infinity e$B$K$J$j$^$9!#e(B
$ ruby19 -e ‘p (“1E1” + “0” * 10000).to_f’
Infinity
- limit(1) e$B$Ge(B 3 ** 4 e$B$r7W;;$9$k$He(B 90
e$B$K$J$j$^$9$,0U?^E*$G$7$g$&$+!#e(B
$ ruby19 -rbigdecimal -e ‘BigDecimal.limit(1); p BigDecimal(“3”) ** 4’
#BigDecimal:8261300,‘0.9E2’,4(12)
e$B$A$c$s$HDI$C$F$J$$$G$9$,!“e(B3 * 3 * 3 * 3 = 10 * 3 * 3 = 30 * 3 = 90
e$B$He(B
e$B$J$C$F$$$k$N$+$J$”$H;W$$$^$9!#;EMM$@$H8@$o$l$l$PG<F@$7$^$9!#e(B