mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
@@ -6839,9 +6839,25 @@ vim_to_msgpack_error_ret: \
|
|||||||
|
|
||||||
#define CONV_FLOAT(flt) \
|
#define CONV_FLOAT(flt) \
|
||||||
do { \
|
do { \
|
||||||
char numbuf[NUMBUFLEN]; \
|
const float_T flt_ = (flt); \
|
||||||
vim_snprintf(numbuf, NUMBUFLEN - 1, "%g", (flt)); \
|
switch (fpclassify(flt_)) { \
|
||||||
ga_concat(gap, (char_u *) numbuf); \
|
case FP_NAN: { \
|
||||||
|
ga_concat(gap, (char_u *) "str2float('nan')"); \
|
||||||
|
break; \
|
||||||
|
} \
|
||||||
|
case FP_INFINITE: { \
|
||||||
|
if (flt_ < 0) { \
|
||||||
|
ga_append(gap, '-'); \
|
||||||
|
} \
|
||||||
|
ga_concat(gap, (char_u *) "str2float('inf')"); \
|
||||||
|
break; \
|
||||||
|
} \
|
||||||
|
default: { \
|
||||||
|
char numbuf[NUMBUFLEN]; \
|
||||||
|
vim_snprintf(numbuf, NUMBUFLEN - 1, "%g", flt_); \
|
||||||
|
ga_concat(gap, (char_u *) numbuf); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define CONV_FUNC(fun) \
|
#define CONV_FUNC(fun) \
|
||||||
|
Reference in New Issue
Block a user