History

change number type to double and increase precision when printing

Sigrid Haflínudóttir committed 6 years ago

Commit 49131f21 parent a20f9112 files · +3 −2Browse files

Unified · Split

2 files
  1. aa.c +2 −1
  2. aa.h +1 −1
aa.c+2−1
@@ -428,7 +428,7 @@ aa_write(aaContext *ctx, aaObject *obj, aaWriteFn fn, void *udata, int qt) · 427 unmodified lines
428428 break;
429429
430430 case AA_TNUMBER:
431− sprint(buf, "%.7g", NUMBER(obj));
431+ sprint(buf, "%.9g", NUMBER(obj));
432432 writestr(ctx, fn, udata, buf);
433433 break;
434434
@@ -933,6 +933,7 @@ aa_open(void *ptr, int size, int flags) · 498 unmodified lines
933933 }
934934 aa_set(ctx, aa_symbol(ctx, "#t"), &True);
935935 aa_set(ctx, aa_symbol(ctx, "#f"), &False);
936+ aa_restoregc(ctx, save);
936937
937938 if((flags & AA_NOSTDIO) == 0){
938939 Binit(&ctx->fd[0], 0, OREAD);
aa.h+1−1
@@ -1,6 +1,6 @@
11 #define GCSTACKSIZE 256
22
3−typedef float aaNumber;
3+typedef double aaNumber;
44
55 typedef struct aaObject aaObject;
66 typedef struct aaContext aaContext;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t