Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

commit c4b5abbe43d7c22215ef36ef4f7c1413c975678c
Author: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Date: Fri Jan 29 10:45:36 2021 +0100
fix data type
commit f87842483eee9d158f44d51d4c09662c3cff7526
Author: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Date: Fri Jan 29 09:56:12 2021 +0100
Ts = sort!(Base.uniontypes(Base.BitInteger), by=T->(!(T<:Signed),sizeof(T)));
for (i, T) in enumerate(Ts), (j, S) in enumerate(Ts)
i < j || continue
(T <: Signed) ⊻ (S <: Signed) || continue
P = promote_type(T, S)
@printf "%-7s + %-7s => %-7s\n" T S P
end