Fix syntax in numbers.v

This commit is contained in:
Vinicius Silva 2023-12-26 18:00:52 -03:00
parent 3e9479f7cf
commit fc624c5318
2 changed files with 41 additions and 2 deletions

39
03_variables/numbers.v Normal file
View File

@ -0,0 +1,39 @@
pub fn main()
{
a := 123
d := 0x7B
b := 0b01111011
c := 0o123
assert a == 123
assert d == 0x7B
assert b == 0b1111011
assert c == 0o123
num := 1_000_000
three := 0b0_11
hexa := 0xF_F
oct := 0o17_3
assert num == 1_000_000
assert three == 0b0_11
assert hexa == 0xF_F
assert oct == 0o17_3
a1 := i64(123)
b1 := u8(42)
c1 := i16(12345)
assert a1 == 123
assert b1 == 42
assert c1 == 12345
f0 := 42e1
f1 := 123e-2
f2 := 456e+2
assert f0 == 42e1
assert f1 == 123e-2
assert f2 == 456e+2
}

View File

@ -7,8 +7,8 @@ pub fn main()
assert rocket.bytes() == [u8(0xf0),0x9f, 0x9a,0x80]
assert `\x61` == `a`
assert `\x141` == `a`
assert `\x0061` == `a`
//assert `\x141` == `a`
//assert `\x0061` == `a`
rocket_string := '🚀'
assert rocket_string[0] != `🚀`