Open
Description
BigDecimal#**
is expect to return BigDecimal
/* call-seq:
* self ** other -> bigdecimal
*
* Returns the \BigDecimal value of +self+ raised to power +other+:
* ...
*/
BigDecimal(123).power(10, 10)
# => 0.792594609605189126649e21 (BigDecimal) OK except too high precision
BigDecimal(123).power(10.5, 10)
# => 8790299449000000000000 (Integer) Questionable result
BigDecimal(123) ** BigDecimal('10.5')
#=> 0.879029945260967009185694434e22 BigDecimal, OK
# => 8790299449000000000000 (Integer) Definitely a bug.
BigMath.exp
returning Integer is the cause.
# /* call-seq:
# * BigMath.exp(decimal, numeric) -> BigDecimal
BigMath.exp(10, 5)
# => 22026 (Integer)
BigMath.exp(10, 6)
# => 0.220265e5 (BigDecimal)
Metadata
Metadata
Assignees
Labels
No labels