From: Yusuke ENDOH Date: 2010-02-19T01:38:47+09:00 Subject: [ruby-core:28228] Re: Is Math module a wrapper of libm? Hi, 2010/2/19 Marc-Andre Lafortune : > On Thu, Feb 18, 2010 at 7:25 AM, Yusuke ENDOH wrote: >> At first, I'll soon change the behaviors of atanh(1) and lgamma(inf) >> which are currently platform-dependent. According to SUSv3, the former >> should raise ERANGE (currently raises EDOM on Linux), and the latter >> should return inf (currently raises EDOM on darwin). > > I disagree with this reading. SUSv3 states that atanh(1) should return > Infinity and (only when the application has requested that behavior) > set the ERANGE error flag. Ruby must choose to do one or the other (or > else add a way to do both). Ah, I'm sorry for my neglect. We should decide the policy too. But I have already commited the change to quickly fix platform- dependent behavior. And I pass the baton on to muraken. He'll suggest a patch. > Look at the graph of 1/x. Look at the graph of Log(x). Now explain to > me why 1/0.0 is +Inf and Log(x) would not be -Inf? Hmm. In aspect of software engineering, I guess it is parhaps a bug if log(0.0) is actually evaluated, so it is good to raise an exception. I think 1/0.0 also should raise an exception because of the same reason. But it cannot be changed for compatibility. Anyway, please wait for muraken's suggestion. -- Yusuke ENDOH