|
|
Subscribe / Log in / New account

Signed overflow optimization hazards in the kernel

Signed overflow optimization hazards in the kernel

Posted Aug 23, 2012 9:54 UTC (Thu) by georgm (subscriber, #19574)
Parent article: Signed overflow optimization hazards in the kernel

A question:

What is the reason to write "if((a-b) < 0) ..." instead of just "if(a<b)"?


to post comments

Signed overflow optimization hazards in the kernel

Posted Aug 23, 2012 10:28 UTC (Thu) by georgm (subscriber, #19574) [Link]

The question concerns signed values, where wraps are not common. Unsigned benefit is clear.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds