Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
fb82e75c
Commit
fb82e75c
authored
May 13, 2010
by
antirez
Browse files
include limits.h otherwise no double precison macros
parent
88e8d89f
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
fb82e75c
...
@@ -57,6 +57,7 @@
...
@@ -57,6 +57,7 @@
#include <sys/resource.h>
#include <sys/resource.h>
#include <sys/uio.h>
#include <sys/uio.h>
#include <limits.h>
#include <limits.h>
#include <float.h>
#include <math.h>
#include <math.h>
#include <pthread.h>
#include <pthread.h>
...
@@ -3523,8 +3524,8 @@ static int rdbSaveDoubleValue(FILE *fp, double val) {
...
@@ -3523,8 +3524,8 @@ static int rdbSaveDoubleValue(FILE *fp, double val) {
* where casting to long long is safe. Then using two castings we
* where casting to long long is safe. Then using two castings we
* make sure the decimal part is zero. If all this is true we use
* make sure the decimal part is zero. If all this is true we use
* integer printing function that is much faster. */
* integer printing function that is much faster. */
double
min
=
-
4503599627370495
;
double
min
=
-
4503599627370495
;
/* (2^52)-1 */
double
max
=
4503599627370496
;
double
max
=
4503599627370496
;
/* -(2^52) */
if
(
val
>
min
&&
val
<
max
&&
val
==
((
double
)((
long
long
)
val
)))
if
(
val
>
min
&&
val
<
max
&&
val
==
((
double
)((
long
long
)
val
)))
ll2string
((
char
*
)
buf
+
1
,
sizeof
(
buf
),(
long
long
)
val
);
ll2string
((
char
*
)
buf
+
1
,
sizeof
(
buf
),(
long
long
)
val
);
else
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment