Permalink
Browse files

Use isnan() and isinf() instead of fpclassify() for platforms which d…

…on't have fpclassify().
  • Loading branch information...
1 parent 005cc60 commit 217cbb89413dfe17f26d251a22d2cab695de22a5 @kubo committed Jan 22, 2012
Showing with 7 additions and 4 deletions.
  1. +5 −0 ChangeLog
  2. +2 −4 ext/oci8/ocinumber.c
View
5 ChangeLog
@@ -1,3 +1,8 @@
+2012-01-22 KUBO Takehiro <kubo@jiubao.org>
+ * ext/oci8/ocinumber.c: Use isnan() and isinf() instead of fpclassify()
+ for platforms which don't have fpclassify().
+ (reported by John Beckwith)
+
2012-01-19 KUBO Takehiro <kubo@jiubao.org>
* ext/oci8/extconf.rb, pre-distclean.rb, ruby-oci8.gemspec: create map files
of oci8lib_*.so on mingw32 in case of analyzing a core (minidump) file.
View
6 ext/oci8/ocinumber.c
@@ -332,12 +332,10 @@ double oci8_onum_to_dbl(OCINumber *s, OCIError *errhp)
OCINumber *oci8_dbl_to_onum(OCINumber *result, double dbl, OCIError *errhp)
{
- switch (fpclassify(dbl)) {
- case FP_NAN:
+ if (isnan(dbl)) {
rb_raise(rb_eFloatDomainError, "NaN");
/* never reach here */
- break;
- case FP_INFINITE:
+ } else if (isinf(dbl)) {
if (dbl > 0.0) {
oranumber_from_str(result, "~", 1);
} else {

0 comments on commit 217cbb8

Please sign in to comment.