[#25936] [Bug:1.9] [rubygems] $LOAD_PATH includes bin directory — Nobuyoshi Nakada <nobu@...>

Hi,

10 messages 2009/10/05

[#25943] Disabling tainting — Tony Arcieri <tony@...>

Would it make sense to have a flag passed to the interpreter on startup that

16 messages 2009/10/05

[#26028] [Bug #2189] Math.atanh(1) & Math.atanh(-1) should not raise an error — Marc-Andre Lafortune <redmine@...>

Bug #2189: Math.atanh(1) & Math.atanh(-1) should not raise an error

14 messages 2009/10/10

[#26222] [Bug #2250] IO::for_fd() objects' finalization dangerously closes underlying fds — Mike Pomraning <redmine@...>

Bug #2250: IO::for_fd() objects' finalization dangerously closes underlying fds

11 messages 2009/10/22

[#26244] [Bug #2258] Kernel#require inside rb_require() inside rb_protect() inside SysV context fails — Suraj Kurapati <redmine@...>

Bug #2258: Kernel#require inside rb_require() inside rb_protect() inside SysV context fails

24 messages 2009/10/22

[#26361] [Feature #2294] [PATCH] ruby_bind_stack() to embed Ruby in coroutine — Suraj Kurapati <redmine@...>

Feature #2294: [PATCH] ruby_bind_stack() to embed Ruby in coroutine

42 messages 2009/10/27

[#26371] [Bug #2295] segmentation faults — tomer doron <redmine@...>

Bug #2295: segmentation faults

16 messages 2009/10/27

[ruby-core:26044] [Bug #2189](Open) Math.atanh(1) & Math.atanh(-1) should not raise an error

From: Marc-Andre Lafortune <redmine@...>
Date: 2009-10-10 17:23:13 UTC
List: ruby-core #26044
Issue #2189 has been updated by Marc-Andre Lafortune.

Status changed from Assigned to Open

I should have ran make test-all, I'm sorry. I also should have realized that the correct solution should have been more careful about platform independence. I'll be more careful in the future. I will also have to find out why I currently get 6 failures and 3 errors running test-all...

----------------

As to the question if atanh should raise an error or return +/- infinity, I'd like to point out:

a) The SUSv3 sentence given above continues and states "If x is 賊1, a pole error shall occur, and atanh() shall return the value of the macro HUGE_VAL with the same sign as the correct value of the function."

Since it is not possible to both return a value and raise an error in Ruby, a choice must be made even if one wants to follow SUSv3.

Also, isn't a pole error different from a range error or a domain error in that document?

b) In math, atanh(tanh(x)) == x. Since tanh(x=1.0/0) doesn't raise an error, I believe atanh should not raise an error and return x.

c) atanh(賊1) returns 賊infinity in the following programs:
- Mathematica
- Matlab
- Python
- C++ boost library

I therefore suggest to make an explicit check for 賊1 and return 賊Infinity in those cases, so to have a result that is:
- platform independent (1.8.x's result is currently platform dependent) 
- useful
- mathematically valid

Thanks
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2189

----------------------------------------
http://redmine.ruby-lang.org

In This Thread