File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -732,6 +732,9 @@ self を other で割り、その(剰余を考えない)商を整数に切り上
732732@return 計算結果
733733@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
734734@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
735+ #@since 3.4
736+ @raise ArgumentError 計算結果が巨大になりすぎる場合に発生します。
737+ #@end
735738
736739#@samplecode
7377402 ** 3 # => 8
@@ -745,6 +748,7 @@ self を other で割り、その(剰余を考えない)商を整数に切り上
7457485.pow(2, -8) # => -7
746749#@end
747750
751+ #@until 3.4
748752結果が巨大すぎる整数になりそうなとき、警告を出したうえで Float::INFINITY を返します。
749753
750754#@samplecode 計算を放棄して Float::INFINITY を返す例
@@ -754,6 +758,18 @@ p 100**9999999
754758#@end
755759
756760判定の閾値は変わりえます。
761+ #@end
762+
763+ #@since 3.4
764+ 計算結果が巨大すぎるときは ArgumentError が発生します。
765+
766+ #@samplecode 計算結果が巨大すぎる例
767+ p 100**9999999999999999999
768+ # => exponent is too large (ArgumentError)
769+ #@end
770+
771+ 判定の閾値は変わりえます。
772+ #@end
757773
758774@see [[m:BigDecimal#power]]
759775
Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ r * Rational(1, 2) # => (3/8)
4545冪(べき)乗を計算します。
4646
4747@param other 自身を other 乗する数
48+ #@since 3.4
49+ @raise ArgumentError 計算結果の分母・分子が巨大すぎる場合に発生します。
50+ #@end
4851
4952other に [[c:Float]] を指定した場合は、計算結果を [[c:Float]] で返しま
5053す。other が有理数であっても、計算結果が無理数だった場合は [[c:Float]]
You can’t perform that action at this time.
0 commit comments