-
-
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
promote_type(Int16, Float16) and promote_type(Int32, Float32) produce lossy types #24435
Comments
It was an intentional choice. By the same logic should |
The spec for |
So it seems that |
The |
If you feel the current behavior is correct, then the documentation needs to change. However, the "without loss, whenever possible." property is pretty nice. On my computer, |
I can think of two easy ways to fix this problem.
|
|
Also |
In general, we've found that widening of types is a thing that should be explicitly asked for when retention of precision is required. This is not what we originally believed going into this, which was much closer to one should retain precision when possible up to hardware limitations. |
@mschauer The documentation of |
Again, all that I wish to point out in this issue is a discrepancy between what the documentation of Most users, after reading the help entry for It looks like it is time to change the documentation for A |
Exactly, I am just arguing that |
promote_type(Int16, Float16)
should produceFloat32
andpromote_type(Int32, Float32)
should produceFloat64
, the smallest available types on my system which represent all of the integer values without loss. However, these two methods produceFloat16
andFloat32
respectively, which cannot accurately represent all of the necessary values.This is a bug right?
The text was updated successfully, but these errors were encountered: