1 parent
c68ad08805
commit
6944d81bc8
2 files changed
+13
-12
No files matched your search
@@ -216,16 +216,11 @@ enum {
|
||||
#define JVP_FLAGS_NUMBER_NATIVE_STR JVP_MAKE_FLAGS(JV_KIND_NUMBER, JVP_MAKE_PFLAGS(JVP_NUMBER_NATIVE, 1))
|
||||
#define JVP_FLAGS_NUMBER_LITERAL JVP_MAKE_FLAGS(JV_KIND_NUMBER, JVP_MAKE_PFLAGS(JVP_NUMBER_DECIMAL, 1))
|
||||
|
||||
#define STR(x) #x
|
||||
#define XSTR(x) STR(x)
|
||||
#define DBL_MAX_STR XSTR(DBL_MAX)
|
||||
#define DBL_MIN_STR "-" XSTR(DBL_MAX)
|
||||
|
||||
// the decimal precision of binary double
|
||||
#define BIN64_DEC_PRECISION (17)
|
||||
#define DEC_NUMBER_STRING_GUARD (14)
|
||||
|
||||
#include <jv_thread.h>
|
||||
#include "jv_thread.h"
|
||||
#ifdef WIN32
|
||||
/* Copied from Heimdal: thread-specific keys; see lib/base/dll.c in Heimdal */
|
||||
|
||||
@@ -658,12 +653,12 @@ static const char* jvp_literal_number_literal(jv n) {
|
||||
}
|
||||
|
||||
if (decNumberIsInfinite(pdec)) {
|
||||
// For backward compatibility.
|
||||
if (decNumberIsNegative(pdec)) {
|
||||
return DBL_MIN_STR;
|
||||
} else {
|
||||
return DBL_MAX_STR;
|
||||
}
|
||||
// We cannot preserve the literal data of numbers outside the limited
|
||||
// range of exponent. Since `decNumberToString` returns "Infinity"
|
||||
// (or "-Infinity"), and to reduce stack allocations as possible, we
|
||||
// normalize infinities in the callers instead of printing the maximum
|
||||
// (or minimum) double here.
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (plit->literal_data == NULL) {
|
||||
|
||||
Reference in new issue
Block a user