This commit is contained in:
commit
568474d52f
1591 files changed
+528213
No files matched your search
@@ -0,0 +1,22 @@
|
||||
# probe: sized integers wrapping, and // and % with negative operands
|
||||
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
|
||||
# expect-stdout: 125
|
||||
# expect-stdout: -126
|
||||
# expect-stdout: -121
|
||||
# expect-stdout: 254
|
||||
# expect-stdout: 7 3 2 1 2
|
||||
# expect-stdout: -7 3 -3 2 -2
|
||||
# expect-stdout: 7 -3 -3 -2 -2
|
||||
# expect-stdout: -7 -3 2 -1 2
|
||||
def main():
|
||||
var a: Int8 = 120
|
||||
for _ in range(3):
|
||||
a += 5
|
||||
print(a)
|
||||
var u: UInt8 = 3
|
||||
u -= 5
|
||||
print(u)
|
||||
for pair in [(7, 3), (-7, 3), (7, -3), (-7, -3)]:
|
||||
var x = pair[0]
|
||||
var y = pair[1]
|
||||
print(x, y, x // y, x % y, x / y)
|
||||
Reference in new issue
Block a user