aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-11-22 00:13:52 +0000
committerGinger Bill <bill@gingerbill.org>2016-11-22 00:13:52 +0000
commit36ad9dae43cd21d8532994cd0d0e92a89af0ed04 (patch)
tree2ab180093e4d5ac1e6ed39ed3b8ce5437255ffb5 /code
parent24347ced45aabd3ce4f4a261b8140a976cadff2e (diff)
128 bit integers
Kind of works but may be buggy due to LLVM not actually sure
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin42
1 files changed, 37 insertions, 5 deletions
diff --git a/code/demo.odin b/code/demo.odin
index b44d245e8..3912fb9f1 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -4,16 +4,48 @@
variadic :: proc(args: ..any) {
for i := 0; i < args.count; i++ {
match type a : args[i] {
- case int: fmt.println("int", a)
- case f32: fmt.println("f32", a)
- case f64: fmt.println("f64", a)
- case string: fmt.println("string", a)
+ case u128: fmt.println("u128", a)
+ case i128: fmt.println("i128", a)
}
}
+
+ fmt.println(..args)
}
main :: proc() {
fmt.println("Hellope, everybody!")
- variadic(1, 1.0 as f32, 1.0 as f64, "Hellope")
+
+
+ variadic(1 as u128,
+ 1 as i128,
+ )
+
+ x: i128 = 321312321
+ y: i128 = 123123123
+ z: i128
+ x *= x; x *= x
+ y *= y; y *= y
+ fmt.println("x =", x)
+ fmt.println("y =", y)
+ z = x + y; fmt.println("x + y", z)
+ z = x - y; fmt.println("x - y", z)
+ z = x * y; fmt.println("x * y", z)
+ z = x / y; fmt.println("x / y", z)
+ z = x % y; fmt.println("x % y", z)
+ z = x & y; fmt.println("x & y", z)
+ z = x ~ y; fmt.println("x ~ y", z)
+ z = x | y; fmt.println("x | y", z)
+ z = x &~ y; fmt.println("x &~ y", z)
+
+ z = -x
+ z = ~x
+
+ b: bool
+ b = x == y; fmt.println("x == y", b)
+ b = x != y; fmt.println("x != y", b)
+ b = x < y; fmt.println("x < y", b)
+ b = x <= y; fmt.println("x <= y", b)
+ b = x > y; fmt.println("x > y", b)
+ b = x >= y; fmt.println("x >= y", b)
}