|
|
|
|
|
by eridius
3708 days ago
|
|
That doesn't actually eliminate range checks. Hardware doesn't have native saturating overflow operations so the saturating overflow methods are implemented by doing a checked overflow and using the min/max value of the type if it overflows/underflows. Which is to say, it removes them from your code, but there's no performance benefit to it. |
|
Uh, what hardware are you talking about? x86 and ARM at the least have saturating arithmetic instructions.