Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
b54cdfb2
Commit
b54cdfb2
authored
Mar 22, 2012
by
antirez
Browse files
Code style hack.
parent
7b22c44c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/object.c
View file @
b54cdfb2
...
...
@@ -48,7 +48,7 @@ robj *createStringObjectFromLongLong(long long value) {
/* Note: this function is defined into object.c since here it is where it
* belongs but it is actually designed to be used just for INCRBYFLOAT */
robj
*
createStringObjectFromLongDouble
(
long
double
value
)
{
char
buf
[
256
]
,
*
p
;
char
buf
[
256
];
int
len
;
/* We use 17 digits precision since with 128 bit floats that precision
...
...
@@ -58,8 +58,8 @@ robj *createStringObjectFromLongDouble(long double value) {
* a string are exactly the same as what the user typed.) */
len
=
snprintf
(
buf
,
sizeof
(
buf
),
"%.17Lf"
,
value
);
/* Now remove trailing zeroes after the '.' */
if
(
(
p
=
strchr
(
buf
,
'.'
)
)
!=
NULL
)
{
p
=
buf
+
len
-
1
;
if
(
strchr
(
buf
,
'.'
)
!=
NULL
)
{
char
*
p
=
buf
+
len
-
1
;
while
(
*
p
==
'0'
)
{
p
--
;
len
--
;
...
...
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