Github Add saturating abs/neg by workingjubilee · Pull Request #87 · rust-lang/s...
source link: https://github.com/rust-lang/stdsimd/pull/87
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
New issue
Add saturating abs/neg #87
Merged
Conversation
Simple branchless software implementations for saturating abs/neg, for all the people using them on vectors that might contain i{N}::MIN.
i don't even know what saturating abs and neg do.
can the docs have like, a words description without needing to puzzle out the code sample?
Added.
For every signed integer the lowest value is greater than the highest value, so if you do abs() you overflow and get the minimum number back again in Rust (in other langs you get undef!).
No one assigned
None yet
No milestone
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK