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 | 6419dce2830bd56554bd5286aaa7d855022b67e9 (patch) | |
| tree | 5e6fdffdb04c0ec6955418cdaaf18c85e38f9490 /complex.c | |
| parent | 1525a9c9f0b1fd754e39965b34fe259647d9175a (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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'complex.c')
| -rw-r--r-- | complex.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |
