Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…on't have fpclassify().
  • Loading branch information...
commit 217cbb89413dfe17f26d251a22d2cab695de22a5 1 parent 005cc60
Kubo Takehiro authored

Showing 2 changed files with 7 additions and 4 deletions. Show diff stats Hide diff stats

  1. +5 0 ChangeLog
  2. +2 4 ext/oci8/ocinumber.c
5 ChangeLog
... ... @@ -1,3 +1,8 @@
  1 +2012-01-22 KUBO Takehiro <kubo@jiubao.org>
  2 + * ext/oci8/ocinumber.c: Use isnan() and isinf() instead of fpclassify()
  3 + for platforms which don't have fpclassify().
  4 + (reported by John Beckwith)
  5 +
1 6 2012-01-19 KUBO Takehiro <kubo@jiubao.org>
2 7 * ext/oci8/extconf.rb, pre-distclean.rb, ruby-oci8.gemspec: create map files
3 8 of oci8lib_*.so on mingw32 in case of analyzing a core (minidump) file.
6 ext/oci8/ocinumber.c
@@ -332,12 +332,10 @@ double oci8_onum_to_dbl(OCINumber *s, OCIError *errhp)
332 332
333 333 OCINumber *oci8_dbl_to_onum(OCINumber *result, double dbl, OCIError *errhp)
334 334 {
335   - switch (fpclassify(dbl)) {
336   - case FP_NAN:
  335 + if (isnan(dbl)) {
337 336 rb_raise(rb_eFloatDomainError, "NaN");
338 337 /* never reach here */
339   - break;
340   - case FP_INFINITE:
  338 + } else if (isinf(dbl)) {
341 339 if (dbl > 0.0) {
342 340 oranumber_from_str(result, "~", 1);
343 341 } else {

0 comments on commit 217cbb8

Please sign in to comment.
Something went wrong with that request. Please try again.