diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 08:07:39 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 08:07:39 +0000 |
commit | 9d2c121e6a6644addf2bc2c0984b0f8e32693f7f (patch) | |
tree | 5e6fdffdb04c0ec6955418cdaaf18c85e38f9490 | |
parent | aa90ca2669ecbad3a925cb6f3649400c0bc00016 (diff) |
merges r21945 from trunk into ruby_1_9_1.
* complex.c (f_signbit): regard NaN as a positive value.
[ruby-dev:37861].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | complex.c | 4 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Mon Feb 2 12:41:52 2009 Shugo Maeda <shugo@ruby-lang.org> + + * complex.c (f_signbit): regard NaN as a positive value. + [ruby-dev:37861]. + Mon Feb 2 06:51:36 2009 NAKAMURA Usaku <usa@ruby-lang.org> * encoding.c (rb_filesystem_encoding): Windows' filesystem encoding is @@ -894,8 +894,10 @@ f_signbit(VALUE x) #else { char s[2]; + double f = RFLOAT_VALUE(x); - (void)snprintf(s, sizeof s, "%.0f", RFLOAT_VALUE(x)); + if (isnan(f)) return Qfalse; + (void)snprintf(s, sizeof s, "%.0f", f); return f_boolcast(s[0] == '-'); } #endif |