Implemented numbers with different bases
This commit is contained in:
10
tests/programs/binary.q
Normal file
10
tests/programs/binary.q
Normal file
@ -0,0 +1,10 @@
|
||||
main() {
|
||||
assert 0b0 == 0
|
||||
assert 0b1 == 1
|
||||
assert 0b10 == 2
|
||||
assert 0b11 == 3
|
||||
assert 0b100 == 4
|
||||
assert 0b101 == 5
|
||||
assert 0b110 == 6
|
||||
assert 0b111 == 7
|
||||
}
|
8
tests/programs/hexadecimal.q
Normal file
8
tests/programs/hexadecimal.q
Normal file
@ -0,0 +1,8 @@
|
||||
main() {
|
||||
assert 0x0 == 0
|
||||
assert 0x1 == 1
|
||||
assert 0xA == 10
|
||||
assert 0x10 == 16
|
||||
assert 0xFF == 255
|
||||
assert 0x1000 == 4096
|
||||
}
|
8
tests/programs/octal.q
Normal file
8
tests/programs/octal.q
Normal file
@ -0,0 +1,8 @@
|
||||
main() {
|
||||
assert 0o0 == 0
|
||||
assert 0o1 == 1
|
||||
assert 0o7 == 7
|
||||
assert 0o10 == 8
|
||||
assert 0o100 == 64
|
||||
assert 0o755 == 493
|
||||
}
|
Reference in New Issue
Block a user