mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 02:53:57 +02:00
math.c: tanh overflow
* math.c (tanh): check overflows, and return +-1.0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
aa8e9c63ad
commit
83cfc94563
2 changed files with 5 additions and 1 deletions
|
@ -111,6 +111,8 @@ class TestMath < Test::Unit::TestCase
|
|||
check(Math.sinh(0) / Math.cosh(0), Math.tanh(0))
|
||||
check(Math.sinh(1) / Math.cosh(1), Math.tanh(1))
|
||||
check(Math.sinh(2) / Math.cosh(2), Math.tanh(2))
|
||||
check(+1.0, Math.tanh(+1000.0))
|
||||
check(-1.0, Math.tanh(-1000.0))
|
||||
end
|
||||
|
||||
def test_acosh
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue