From 0ca1b4612c35c649d16476aa67462835249145e8 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 29 Jan 2017 23:13:50 +0000 Subject: Allow _ in floats --- code/demo.odin | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'code') diff --git a/code/demo.odin b/code/demo.odin index ec5ccfb40..21cfb6f63 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -1,13 +1,13 @@ #import "fmt.odin"; main :: proc() { - foo :: proc() -> [dynamic]int { - x: [dynamic]int; - append(^x, 2, 3, 5, 7); - return x; - } + x: [dynamic]f64; + defer free(x); + append(^x, 2_000_000.500_000, 3, 5, 7); - for p in foo() { - fmt.println(p); + for p, i in x { + if i > 0 { fmt.print(", "); } + fmt.print(p); } + fmt.println(); } -- cgit v1.2.3