June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -99,7 +99,7 @@ For 64-bit unsigned integers:
|
|||
| 18446744073709551616
|
||||
|}
|
||||
|
||||
When the integer overflow does trigger an exception show how the exception is catched.
|
||||
When the integer overflow does trigger an exception show how the exception is caught.
|
||||
When the integer overflow produces some value print it.
|
||||
It should be explicitly noted when an integer overflow is not recognized and the program continues with wrong results.
|
||||
This should be done for signed and unsigned integers of various sizes supported by the language.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
s = subtypes(Signed)
|
||||
u = subtypes(Unsigned)
|
||||
S = subtypes(Signed)
|
||||
U = subtypes(Unsigned)
|
||||
|
||||
println("Integer Type Limits")
|
||||
for i in 1:length(s)
|
||||
println(s[i], " [", typemin(s[i]), ", ", typemax(s[i]), "]")
|
||||
println(u[i], " [", typemin(u[i]), ", ", typemax(u[i]), "]")
|
||||
println("Integer limits:")
|
||||
for (s, u) in zip(S, U)
|
||||
@printf("%8s: [%s, %s]\n", s, typemin(s), typemax(s))
|
||||
@printf("%8s: [%s, %s]\n", u, typemin(u), typemax(u))
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
println("Add to typemax")
|
||||
for t in s
|
||||
over = typemax(t) + 1
|
||||
println(t, " => ", over, " (", typeof(over), ")")
|
||||
println("Add one to typemax:")
|
||||
for t in S
|
||||
over = typemax(t) + one(t)
|
||||
@printf("%8s → %-25s (%s)\n", t, over, typeof(over))
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue