Fixed - and + as unary operators, negative numbers, etc
This commit is contained in:
5
tests/test_negative_number_unary.expected_results
Normal file
5
tests/test_negative_number_unary.expected_results
Normal file
@@ -0,0 +1,5 @@
|
||||
-1
|
||||
1
|
||||
-1
|
||||
7
|
||||
-7
|
||||
14
tests/test_negative_number_unary.krak
Normal file
14
tests/test_negative_number_unary.krak
Normal file
@@ -0,0 +1,14 @@
|
||||
import io:*
|
||||
|
||||
|int| main() {
|
||||
|int| a = -1
|
||||
println(a)
|
||||
println(-a)
|
||||
println(+a); // this is still -1! (as C has it, anyway) (darn comment/semicolon interaction)
|
||||
|
||||
|int| b = 7
|
||||
println(b)
|
||||
println(-b)
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user