mirror of
				https://github.com/janet-lang/janet
				synced 2025-11-04 01:23:04 +00:00 
			
		
		
		
	Visual distinction between integers and reals.
Add F suffix to real numbers when printed.
This commit is contained in:
		@@ -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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user