зеркало из https://github.com/github/ruby.git
* complex.c (f_signbit): NaN may be signed value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
ec324872d5
Коммит
28c53aabca
|
@ -1,3 +1,7 @@
|
|||
Thu Dec 4 01:22:41 2008 Tadayoshi Funaba <tadf@dotrb.org>
|
||||
|
||||
* complex.c (f_signbit): NaN may be signed value.
|
||||
|
||||
Wed Dec 3 23:59:32 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* process.c (EXEC_OPTION_DUP2_CHILD): defined.
|
||||
|
|
16
complex.c
16
complex.c
|
@ -887,15 +887,17 @@ f_signbit(VALUE x)
|
|||
switch (TYPE(x)) {
|
||||
case T_FLOAT:
|
||||
#ifdef HAVE_SIGNBIT
|
||||
return f_boolcast(signbit(RFLOAT_VALUE(x)));
|
||||
{
|
||||
double f = RFLOAT_VALUE(x);
|
||||
return f_boolcast(!isnan(f) && signbit(f));
|
||||
}
|
||||
#else
|
||||
{
|
||||
char s[2];
|
||||
{
|
||||
char s[2];
|
||||
|
||||
(void)snprintf(s, sizeof s, "%.0f", RFLOAT_VALUE(x));
|
||||
|
||||
return f_boolcast(s[0] == '-');
|
||||
}
|
||||
(void)snprintf(s, sizeof s, "%.0f", RFLOAT_VALUE(x));
|
||||
return f_boolcast(s[0] == '-');
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return f_negative_p(x);
|
||||
|
|
Загрузка…
Ссылка в новой задаче