-
Notifications
You must be signed in to change notification settings - Fork 694
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
update conversions to use type.method #184
Conversation
* `sint64.from_float64`: truncate a 64-bit float to a signed integer | ||
* `sint64.from_float32`: truncate a 32-bit float to a signed integer | ||
* `uint64.from_float64`: truncate a 64-bit float to an unsigned integer | ||
* `uint64.from_float32`: truncate a 32-bit float to an unsigned integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is slightly inconsistent because sint32 et al aren't local types. Would int32.from_float64_sx
etc. be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that too, but that isn't pretty either. _sx when converting between int and float seems completely bizarre.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. How about int32.strunc_float64
and int32.utrunc_float64
? Or is strunc
too silly sounding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I think that sounds pretty good. I was actually rewording now to be along those lines. Will have a new iteration in a few mins, let's see if it sounds better
* `float64.cvt_signed[int64]`: convert a signed 64-bit integer to a 64-bit float | ||
* `float64.cvt_unsigned[int32]`: convert an unsigned 32-bit integer to a 64-bit float | ||
* `float64.cvt_unsigned[int64]`: convert an unsigned 64-bit integer to a 64-bit float | ||
* `float64.reinterpret[int64]`: reinterpret the bits of a 64-bit integer as a 64-bit float |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this sounds somewhat better, but maybe having all these different ones is too verbose, especially if you consider the case of someone writing text format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me, especially for now.
lgtm |
lgtm as well. This is cleaner than before. |
update conversions to use type.method
No description provided.