From c59f6b7d0b582131bed4450bbb9aa1a71d5a01af Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 26 Feb 2017 00:44:26 +0000 Subject: ++ -- statements; add strconv.odin (and replace some of the fmt procs); Fix ~ on 64 bit constants; Fix integer casts from smaller to larger size --- code/demo.odin | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'code') diff --git a/code/demo.odin b/code/demo.odin index c548a9430..345ac7922 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -5,14 +5,19 @@ #import "mem.odin"; #import "opengl.odin"; #import "os.odin"; - -foo :: proc(x: int) -> f32 { - return 123; -} +#import "strconv.odin"; main :: proc() { + buf: [64]byte; + // len := strconv.generic_ftoa(buf[:], 123.5431, 'f', 4, 64); + x := 624.123; + s := strconv.format_float(buf[:], x, 'f', 6, 64); + fmt.println(s); + fmt.printf("%.3f\n", x); + + i := 123; + fmt.println(123); - fmt.printf("%T\n", foo); when false { /* -- cgit v1.2.3