We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9284453 commit e61cbcaCopy full SHA for e61cbca
src/njs_number.h
@@ -8,7 +8,9 @@
8
#define _NJS_NUMBER_H_INCLUDED_
9
10
11
-#define NJS_MAX_LENGTH (0x1fffffffffffffLL)
+#define NJS_MAX_LENGTH (0x1fffffffffffffLL)
12
+#define NJS_INT64_DBL_MIN (-9.223372036854776e+18) /* closest to INT64_MIN */
13
+#define NJS_INT64_DBL_MAX (9.223372036854776e+18) /* closest to INT64_MAX */
14
15
16
double njs_key_to_index(const njs_value_t *value);
@@ -57,10 +59,10 @@ njs_inline int64_t
57
59
njs_number_to_integer(double num)
58
60
{
61
if (njs_fast_path(!isnan(num))) {
- if (num < INT64_MIN) {
62
+ if (num < NJS_INT64_DBL_MIN) {
63
return INT64_MIN;
64
- } else if (num > INT64_MAX) {
65
+ } else if (num > NJS_INT64_DBL_MAX) {
66
return INT64_MAX;
67
}
68
0 commit comments