Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Integer-overflow/Julia/integer-overflow-1.julia
Normal file
9
Task/Integer-overflow/Julia/integer-overflow-1.julia
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
using Printf
|
||||
S = subtypes(Signed)
|
||||
U = subtypes(Unsigned)
|
||||
|
||||
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
|
||||
5
Task/Integer-overflow/Julia/integer-overflow-2.julia
Normal file
5
Task/Integer-overflow/Julia/integer-overflow-2.julia
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
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