Actions
Bug #17264
closedBigDecimal exponentiation cannot be used with #** method
Bug #17264:
BigDecimal exponentiation cannot be used with #** method
ruby -v:
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
Description
As stated in Bug #17214 (https://bugs.ruby-lang.org/issues/17214) when exponentiating a BigDdecimal number even when using small numbers, a precision argument must be passed to the operation or the operation will return wrong result, 2222 and 3.5 not being 'huge' numbers:
However the #** method cannot be passed a precision argument and as seen above it will return wrong values for small numbers even if the BigDecimal numbers themselves have a large precision argument.
Therefore this operation can only be valid if used with the #power method and provided with a larger precision argument:
My suggestion is the #** method and #power method should work the same way or the #** method retired.
Actions