Mercurial > hg > octave-lojdl
changeset 4075:9a2102864eb0
[project @ 2002-09-27 21:37:56 by jwe]
author | jwe |
---|---|
date | Fri, 27 Sep 2002 21:37:56 +0000 |
parents | a67f76924703 |
children | c651ee4c0846 |
files | liboctave/lo-cieee.c liboctave/lo-ieee.cc liboctave/lo-ieee.h |
diffstat | 3 files changed, 32 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/lo-cieee.c +++ b/liboctave/lo-cieee.c @@ -72,7 +72,7 @@ lo_ieee_isnan (double x) { #if defined (HAVE_ISNAN) - return lo_ieee_isnan (x) ? ! lo_ieee_is_NA (x) : 0; + return isnan (x) ? ! lo_ieee_is_NA (x) : 0; #else return 0; #endif @@ -102,6 +102,20 @@ #endif } +int +lo_ieee_is_NA (double x) +{ + lo_ieee_double t; + t.value = x; + return (isnan (x) && t.word[lo_ieee_lw] == LO_IEEE_NA_LW) ? 1 : 0; +} + +int +lo_ieee_is_NaN_or_NA (double x) +{ + return lo_ieee_isnan (x); +} + /* ;;; Local Variables: *** ;;; mode: C++ ***
--- a/liboctave/lo-ieee.cc +++ b/liboctave/lo-ieee.cc @@ -57,17 +57,8 @@ // Octave's idea of a missing value. double octave_NA; -static int lo_ieee_hw; -static int lo_ieee_lw; - -typedef union -{ - double value; - unsigned int word[2]; -} lo_ieee_double; - -#define LO_IEEE_NA_HW 0x7ff00000 -#define LO_IEEE_NA_LW 1954 +int lo_ieee_hw; +int lo_ieee_lw; void octave_ieee_init (void) @@ -130,20 +121,6 @@ #endif } -int -lo_ieee_is_NA (double x) -{ - lo_ieee_double t; - t.value = x; - return (lo_ieee_isnan (x) && t.word[lo_ieee_lw] == LO_IEEE_NA_LW) ? 1 : 0; -} - -int -lo_ieee_is_NaN_or_NA (double x) -{ - return lo_ieee_isnan (x); -} - /* ;;; Local Variables: *** ;;; mode: C++ ***
--- a/liboctave/lo-ieee.h +++ b/liboctave/lo-ieee.h @@ -27,6 +27,18 @@ extern "C" { #endif +extern int lo_ieee_hw; +extern int lo_ieee_lw; + +typedef union +{ + double value; + unsigned int word[2]; +} lo_ieee_double; + +#define LO_IEEE_NA_HW 0x7ff00000 +#define LO_IEEE_NA_LW 1954 + // Octave's idea of infinity. extern double octave_Inf; @@ -38,9 +50,6 @@ extern void octave_ieee_init (void); -extern int lo_ieee_is_NA (double); -extern int lo_ieee_is_NaN_or_NA (double); - #if defined (SCO) extern int isnan (double); extern int isinf (double); @@ -50,6 +59,9 @@ extern int lo_ieee_finite (double x); extern int lo_ieee_isinf (double x); +extern int lo_ieee_is_NA (double); +extern int lo_ieee_is_NaN_or_NA (double); + #ifdef __cplusplus } #endif