julia> @emulate UInt9
julia> Int8(-1) < UInt9(0)
ERROR: InexactError: trunc(UInt16, -1)
Stacktrace:
[1] throw_inexacterror(func::Symbol, to::Type, val::Int8)
@ Core ./boot.jl:815
[2] check_sign_bit
@ ./boot.jl:821 [inlined]
[3] toUInt16
@ ./boot.jl:907 [inlined]
[4] UInt16
@ ./boot.jl:960 [inlined]
[5] convert
@ ./number.jl:7 [inlined]
[6] Type
@ ~/.julia/packages/EmulatedBitIntegers/IFk3G/src/interface.jl:3 [inlined]
[7] convert
@ ./number.jl:7 [inlined]
[8] _promote
@ ./promotion.jl:379 [inlined]
[9] promote
@ ./promotion.jl:404 [inlined]
[10] <(x::Int8, y::UInt9)
@ Base ./promotion.jl:488
[11] top-level scope
@ REPL[3]:1
Tested with Julia 1.12.7 and EmulatedBitIntegers v0.4.2.
Tested with Julia 1.12.7 and EmulatedBitIntegers v0.4.2.