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
428 break;428 break;
429 429
430 case AA_TNUMBER:430 case AA_TNUMBER:
431 sprint(buf, "%.7g", NUMBER(obj));431 sprint(buf, "%.9g", NUMBER(obj));
432 writestr(ctx, fn, udata, buf);432 writestr(ctx, fn, udata, buf);
433 break;433 break;
434 434
@@ -933,6 +933,7 @@ aa_open(void *ptr, int size, int flags) · 498 unmodified lines
933 }933 }
934 aa_set(ctx, aa_symbol(ctx, "#t"), &True);934 aa_set(ctx, aa_symbol(ctx, "#t"), &True);
935 aa_set(ctx, aa_symbol(ctx, "#f"), &False);935 aa_set(ctx, aa_symbol(ctx, "#f"), &False);
936 aa_restoregc(ctx, save);
936 937
937 if((flags & AA_NOSTDIO) == 0){938 if((flags & AA_NOSTDIO) == 0){
938 Binit(&ctx->fd[0], 0, OREAD);939 Binit(&ctx->fd[0], 0, OREAD);
aa.h+1−1
@@ -1,6 +1,6 @@
1#define GCSTACKSIZE 2561#define GCSTACKSIZE 256
2 2
3typedef float aaNumber;3typedef double aaNumber;
4 4
5typedef struct aaObject aaObject;5typedef struct aaObject aaObject;
6typedef struct aaContext aaContext;6typedef 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