on master help sign in
Show Double with full precision on C backend
commitdeb4d415999d4283422f378dba558d802588a95e authorMelvar Chen <Melvar.Chen@googlemail.com> dateTue 25 Aug 2015, 23:21 (11 years ago) parent073d5ef
1 file changed+1−1
rts/idris_rts.c+1−1
rts/idris_rts.c+1−1
@@ -470,7 +470,7 @@ VAL idris_castFloatStr(VM* vm, VAL i) {
470470 Closure* cl = allocate(sizeof(Closure) + sizeof(char)*32, 0);
471471 SETTY(cl, STRING);
472472 cl -> info.str = (char*)cl + sizeof(Closure);
473− sprintf(cl -> info.str, "%g", GETFLOAT(i));
473+ snprintf(cl -> info.str, 32, "%.16g", GETFLOAT(i));
474474 return cl;
475475}
476476