ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:72879] [Ruby trunk - Bug #11995] [Open] BigDecimal#power fails for some values
       [not found] <redmine.issue-11995.20160115151943@ruby-lang.org>
@ 2016-01-15 15:19 ` dolzenko
  2016-01-16  2:05 ` [ruby-core:72884] [Ruby trunk - Bug #11995] [Rejected] " nobu
  1 sibling, 0 replies; 2+ messages in thread
From: dolzenko @ 2016-01-15 15:19 UTC (permalink / raw
  To: ruby-core

Issue #11995 has been reported by Evgeniy Dolzhenko.

----------------------------------------
Bug #11995: BigDecimal#power fails for some values
https://bugs.ruby-lang.org/issues/11995

* Author: Evgeniy Dolzhenko
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
$ irb -rbigdecimal
> BigDecimal('-0.5').power(BigDecimal('0.2'))
Math::DomainError: Zero or negative argument for log

but

> -0.5**0.2
=> -0.8705505632961241

The same is true for a few other exponent version I have tested. Is that feature or bug?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-core:72884] [Ruby trunk - Bug #11995] [Rejected] BigDecimal#power fails for some values
       [not found] <redmine.issue-11995.20160115151943@ruby-lang.org>
  2016-01-15 15:19 ` [ruby-core:72879] [Ruby trunk - Bug #11995] [Open] BigDecimal#power fails for some values dolzenko
@ 2016-01-16  2:05 ` nobu
  1 sibling, 0 replies; 2+ messages in thread
From: nobu @ 2016-01-16  2:05 UTC (permalink / raw
  To: ruby-core

Issue #11995 has been updated by Nobuyoshi Nakada.

Status changed from Open to Rejected

The latter is parsed as `-(0.5**0.2)`.

~~~
$ ruby -e 'p (-0.5)**0.2'
(0.7042902001692478+0.5116967824803669i)
~~~

`Float#**` can result an imaginary number, but `BigDecimal` is only for real numbers.


----------------------------------------
Bug #11995: BigDecimal#power fails for some values
https://bugs.ruby-lang.org/issues/11995#change-56117

* Author: Evgeniy Dolzhenko
* Status: Rejected
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
$ irb -rbigdecimal
> BigDecimal('-0.5').power(BigDecimal('0.2'))
Math::DomainError: Zero or negative argument for log

but

> -0.5**0.2
=> -0.8705505632961241

The same is true for a few other exponent version I have tested. Is that feature or bug?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-16  1:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-11995.20160115151943@ruby-lang.org>
2016-01-15 15:19 ` [ruby-core:72879] [Ruby trunk - Bug #11995] [Open] BigDecimal#power fails for some values dolzenko
2016-01-16  2:05 ` [ruby-core:72884] [Ruby trunk - Bug #11995] [Rejected] " nobu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).