add inttype, floattype like uinttype#36526
add inttype, floattype like uinttype#36526musm merged 1 commit intoJuliaLang:masterfrom JeffreySarnoff:jas/floattype
inttype, floattype like uinttype#36526Conversation
|
FixedPointNumbers defines and exports Of course, this is just the problem in a specific ecosystem. |
|
cf. #30445 |
|
bump. I think this would be good to have (at least internally). |
|
I agree that it is not a problem because they are not exported, but I do not think it is good practice to use functions that are not exported. BTW, we can find julia> Base.Threads.inttype(Float32)
Int32The root of the problem is that whether you associate the names |
|
I've also needed these in the past. Since they're internal I find these definitions relatively harmless and are more for convenience. Sans objections I plan on merging this in a day. |
uinttypeis an unexported function that mapsIEEEFloattypes to their bitwidth-matchedUnsignedtypes.This PR adds
inttypeandfloattype(also unexported).inttypemapsIEEEFloatsto bitwidth-matchedSignedtypes andfloattypemapsuinttype(T), inttype(T) where {T<:IEEEFloat}to the bitwidth-matchedIEEEFloattype.I use these functions often -- less elegantly defined (overloading
reinterpretorrem). As they are unexported, I did not add NEWS. Since there are no tests foruinttype, I did not add tests .. although I am happy to do so for all three functions should that be preferred.