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
In order to be able to implement bignums in Lurk directly, we need support for multiplication with carry. Although we can detect overflow for addition, it would be better to have equivalent direct support.
I propose we add new variants of + and * that only work with u64 (and other UInt types, in the future). We might want a variant for - as well. Again, * is the urgent need.
I'll propose that we name these these operators *~, +~, and -~ but I'm open to other suggestions. These should return a pair of u64 values. The first value should be the same value as is returned by * and + respectively. The second should contain the 'carry' values or nil. The reason to prefer nil to an explicit 0u64 is to make checking for carry as cheap as possible.
In order to be able to implement bignums in Lurk directly, we need support for multiplication with carry. Although we can detect overflow for addition, it would be better to have equivalent direct support.
I propose we add new variants of
+
and*
that only work withu64
(and other UInt types, in the future). We might want a variant for-
as well. Again,*
is the urgent need.I'll propose that we name these these operators
*~
,+~
, and-~
but I'm open to other suggestions. These should return a pair ofu64
values. The first value should be the same value as is returned by*
and+
respectively. The second should contain the 'carry' values ornil
. The reason to prefernil
to an explicit0u64
is to make checking for carry as cheap as possible.See example usages with expected results:
The text was updated successfully, but these errors were encountered: