-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add inttype
, floattype
like uinttype
#36526
Conversation
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)
Int32 The 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. |
uinttype
is an unexported function that mapsIEEEFloat
types to their bitwidth-matchedUnsigned
types.This PR adds
inttype
andfloattype
(also unexported).inttype
mapsIEEEFloats
to bitwidth-matchedSigned
types andfloattype
mapsuinttype(T), inttype(T) where {T<:IEEEFloat}
to the bitwidth-matchedIEEEFloat
type.I use these functions often -- less elegantly defined (overloading
reinterpret
orrem
). 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.