diff options
author | dos-reis <gdr@axiomatics.org> | 2008-05-23 01:04:38 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-05-23 01:04:38 +0000 |
commit | 7d85189b98ae004c095f4c1b58804f021f67880a (patch) | |
tree | c1726cb97778147af789898521f060d15eb8afa4 /src/lib/cfuns-c.c | |
parent | 66bf12078133726c7b95d9708472f2032ba458db (diff) | |
download | open-axiom-7d85189b98ae004c095f4c1b58804f021f67880a.tar.gz |
Port htadd to win32
Diffstat (limited to 'src/lib/cfuns-c.c')
-rw-r--r-- | src/lib/cfuns-c.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/lib/cfuns-c.c b/src/lib/cfuns-c.c index 2620be00..fe5380e8 100644 --- a/src/lib/cfuns-c.c +++ b/src/lib/cfuns-c.c @@ -540,3 +540,33 @@ oa_get_tmpdir(void) return "/tmp"; #endif } + + + +OPENAXIOM_EXPORT double +plus_infinity(void ) +{ +#ifdef INFINITY + return INFINITY; +#else + /* This must be a curious platform. */ + volatile double zero = 0.0; + return 1.0 / zero; /* If it traps, well, it traps. */ +#endif +} + +OPENAXIOM_EXPORT double +minus_infinity(void) +{ + return -plus_infinity(); +} + +OPENAXIOM_EXPORT double +NANQ(void) +{ +#ifdef NAN + return NAN; +#else + return sqrt(-1.0); /* Juts pick one. */ +#endif +} |