-
Notifications
You must be signed in to change notification settings - Fork 110
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 add_reverse method #16
Comments
Should this addition perform carry-propagation to the right (on
I do expect this; while the computation required to demangle the pointer into an individual bit access is certainly a non-zero expense, inadequate performance is always a valid bug report. |
We should perform carry-propagation as the regular In
This is why I supposed that we do not target high performance apps. Should we update the doc to remove ambitiousness (maybe was only me that understood it wrong)? Maybe we should add:
|
My reluctance to encourage use of As such, the arithmetic implementations are software reproductions of a ripple-carry adder, which I have made no effort to optimize. It's low-hanging fruit for a CLA design over RCA if this is something users wind up wanting. I'll get an implementation for this issue done this afternoon. Do you have a version to which you'd like it backported, or is current head sufficient? |
Why I cannot interpret the meaning of "Do you have a version to which you'd like it backported, or is current head sufficient?", would you mind to explain it with other words? |
The default The latest version of the crate is |
Thank you for the explanation. Semantic versioning defines the increment of minor version when backwards compatible functionality is introduced to the public API. I think this is the best candidate, by the time that patch version is used most of the times for backwards compatible bug fixes, but I leave it to you to decide. |
It's on |
Looks good. |
We currently implement
Add
andAddAssign
traits that "works just like adding numbers longhand on paper" (right-to-left). It would be nice to have areverse_add()
method that does addition from left-to-right. We can use the same function semantics as add_assign but do not use thestd::iter::Rev
trait that reverse the iteration, i.e. remove the.rev()
call on lines 2230 and 2231. I have already tested it and works fine.Here is an example:
Use case
In the paper of SIMD json parser, the addition operation is done left-to-right (e.g page 7, Fig.3
C = B + ES
). Of course, I do not expect this library to be used in high performance applications, but I found quite convenient to have a such method.The text was updated successfully, but these errors were encountered: