aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-01-29 23:13:50 +0000
committerGinger Bill <bill@gingerbill.org>2017-01-29 23:13:50 +0000
commit0ca1b4612c35c649d16476aa67462835249145e8 (patch)
tree7ae7001d88c03ae5ecf91fd9e33b7db0fcccdaba /code
parent9e143a38ced7d6bda0a8e9d4d3af881858065663 (diff)
Allow _ in floats
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin14
1 files changed, 7 insertions, 7 deletions
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();
}