mirror of
https://github.com/janet-lang/janet
synced 2024-11-20 07:34:49 +00:00
Merge branch 'master' into bundle-tools
This commit is contained in:
commit
6ac65e603d
@ -379,7 +379,10 @@ static int print_jdn_one(struct pretty *S, Janet x, int depth) {
|
|||||||
break;
|
break;
|
||||||
case JANET_NUMBER:
|
case JANET_NUMBER:
|
||||||
janet_buffer_ensure(S->buffer, S->buffer->count + BUFSIZE, 2);
|
janet_buffer_ensure(S->buffer, S->buffer->count + BUFSIZE, 2);
|
||||||
int count = snprintf((char *) S->buffer->data + S->buffer->count, BUFSIZE, "%.17g", janet_unwrap_number(x));
|
double num = janet_unwrap_number(x);
|
||||||
|
if (isnan(num)) return 1;
|
||||||
|
if (isinf(num)) return 1;
|
||||||
|
int count = snprintf((char *) S->buffer->data + S->buffer->count, BUFSIZE, "%.17g", num);
|
||||||
S->buffer->count += count;
|
S->buffer->count += count;
|
||||||
break;
|
break;
|
||||||
case JANET_SYMBOL:
|
case JANET_SYMBOL:
|
||||||
|
Loading…
Reference in New Issue
Block a user