[#100689] [Ruby master Feature#17303] Make webrick to bundled gems or remove from stdlib — hsbt@...
Issue #17303 has been reported by hsbt (Hiroshi SHIBATA).
11 messages
2020/11/02
[#100852] [Ruby master Feature#17326] Add Kernel#must! to the standard library — zimmerman.jake@...
SXNzdWUgIzE3MzI2IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGpleiAoSmFrZSBaaW1tZXJtYW4pLg0K
24 messages
2020/11/14
[#100930] [Ruby master Feature#17333] Enumerable#many? — masafumi.o1988@...
Issue #17333 has been reported by okuramasafumi (Masafumi OKURA).
10 messages
2020/11/18
[#101071] [Ruby master Feature#17342] Hash#fetch_set — hunter_spawn@...
Issue #17342 has been reported by MaxLap (Maxime Lapointe).
26 messages
2020/11/25
[ruby-core:101051] [Ruby master Bug#17264] BigDecimal exponentiation cannot be used with #** method
From:
merch-redmine@...
Date:
2020-11-24 18:25:48 UTC
List:
ruby-core #101051
Issue #17264 has been updated by jeremyevans0 (Jeremy Evans).
Assignee set to mrkn (Kenta Murata)
Status changed from Open to Assigned
karatedog (F=F6ldes L=E1szl=F3) wrote:
> My suggestion is the #** method and #power method should work the same wa=
y or the #** method retired.
The methods actually do operate the same way. `#**` is basically:
```ruby
def **(other)
power(other)
end
```
So the issue is basically the precision for `power` when given one argument=
is not high enough, at least for fractional powers. I've submitted a pull=
request to increase the precision, but the downside is it makes the power =
calculations much slower: https://github.com/ruby/bigdecimal/pull/171. It i=
s up to @mrkn whether the benefits of increasing the precision are worth th=
e performance decrease.
----------------------------------------
Bug #17264: BigDecimal exponentiation cannot be used with #** method
https://bugs.ruby-lang.org/issues/17264#change-88723
* Author: karatedog (F=F6ldes L=E1szl=F3)
* Status: Assigned
* Priority: Normal
* Assignee: mrkn (Kenta Murata)
* ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
As stated in Bug #17214 (https://bugs.ruby-lang.org/issues/17214) when expo=
nentiating 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:
``` ruby
(BigDecimal("2222",10000) ** BigDecimal("3.5",10000)).to_i
# =3D> 517135311000
```
However the #** method cannot be passed a precision argument and as seen ab=
ove it will return wrong values for small numbers even if the BigDecimal nu=
mbers themselves have a large precision argument.
Therefore this operation can only be valid if used with the #power method a=
nd provided with a larger precision argument:
``` ruby
BigDecimal(2222).power(3.5, 15).to_i #=3D> 517135308457
```
My suggestion is the #** method and #power method should work the same way =
or the #** method retired.
-- =
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>