Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Share INFINITY def between files that use it
- Loading branch information
1 parent
4234ab5
commit 96e432d
Showing
3 changed files
with
34 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,36 @@ | ||
#ifndef MATH_NUM_H | ||
#define MATH_NUM_H | ||
|
||
#ifdef _WIN32 | ||
#include <float.h> | ||
#endif | ||
|
||
#if defined(INFINITY) && !defined(_AIX) | ||
static const MVMnum64 MVM_NUM_POSINF = INFINITY; | ||
static const MVMnum64 MVM_NUM_NEGINF = -INFINITY; | ||
#else | ||
# ifdef _MSC_VER | ||
#define MVM_NUM_POSINF (DBL_MAX+DBL_MAX) | ||
#define MVM_NUM_NEGINF -(DBL_MAX+DBL_MAX) | ||
# else | ||
static const MVMnum64 MVM_NUM_POSINF = 1.0 / 0.0; | ||
static const MVMnum64 MVM_NUM_NEGINF = -1.0 / 0.0; | ||
# endif | ||
#endif | ||
|
||
#if defined(NAN) && !defined(_AIX) | ||
static const MVMnum64 MVM_NUM_NAN = NAN; | ||
#else | ||
# ifdef _MSC_VER | ||
#define MVM_NUM_NAN (MVM_NUM_POSINF-MVM_NUM_POSINF) | ||
# else | ||
static const MVMnum64 MVM_NUM_NAN = 0.0 / 0.0; | ||
# endif | ||
#endif | ||
|
||
MVMint64 MVM_num_isnanorinf(MVMThreadContext *tc, MVMnum64 n); | ||
MVMnum64 MVM_num_posinf(MVMThreadContext *tc); | ||
MVMnum64 MVM_num_neginf(MVMThreadContext *tc); | ||
MVMnum64 MVM_num_nan(MVMThreadContext *tc); | ||
|
||
#endif |