You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When converting from an int to i64 or some other pair of types where the new type is smaller than the first, we might end up having to handle overflow somehow. We can truncate / wraparound, perhaps there are other options too.
I wonder though, should truncating or similar destructive behavior not be explicit? We could add a truncate: bool=False argument. With it's default behavior of not truncating, we could throw an exception if there are overflowing bits. The user can opt to explicitly set truncate=True, in which case we'll discard whatever bits are overflowing.
When converting from an
int
toi64
or some other pair of types where the new type is smaller than the first, we might end up having to handle overflow somehow. We can truncate / wraparound, perhaps there are other options too.I wonder though, should truncating or similar destructive behavior not be explicit? We could add a
truncate: bool=False
argument. With it's default behavior of not truncating, we could throw an exception if there are overflowing bits. The user can opt to explicitly set truncate=True, in which case we'll discard whatever bits are overflowing.@sydow @nordlander WDYT?
The text was updated successfully, but these errors were encountered: