1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 02:59:54 +00:00

Visual distinction between integers and reals.

Add F suffix to real numbers when printed.
This commit is contained in:
bakpakin 2017-04-24 21:08:53 -04:00
parent 0a96e45c4a
commit 1d7f42ba01

View File

@ -33,13 +33,13 @@ int gst_truthy(GstValue v) {
static const uint8_t *real_to_string(Gst *vm, GstReal x) {
uint8_t buf[GST_BUFSIZE];
int count = snprintf((char *) buf, GST_BUFSIZE, "%.21g", x);
int count = snprintf((char *) buf, GST_BUFSIZE, "%.21gF", x);
return gst_string_b(vm, buf, (uint32_t) count);
}
static const uint8_t *integer_to_string(Gst *vm, GstInteger x) {
uint8_t buf[GST_BUFSIZE];
int count = snprintf((char *) buf, GST_BUFSIZE, "%ld", x);
int count = snprintf((char *) buf, GST_BUFSIZE, "%lld", x);
return gst_string_b(vm, buf, (uint32_t) count);
}