1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-19 23:24:49 +00:00

Merge branch 'master' into bundle-tools

This commit is contained in:
Calvin Rose 2024-05-19 15:52:25 -05:00
commit 6ac65e603d

View File

@ -379,7 +379,10 @@ static int print_jdn_one(struct pretty *S, Janet x, int depth) {
break;
case JANET_NUMBER:
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;
break;
case JANET_SYMBOL: