Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
duaneb
on June 20, 2012
|
parent
|
context
|
favorite
| on:
The Little C Function From Hell
Isn't that the same situation as only storing signed integers? The arithmetic is just a little different.
ralph
on June 20, 2012
[–]
No, you get room for one more negative int. x = x < 0 ? -x : x; is a common buggy abs(), e.g. when printing an integer. One should test if it's negative, perhaps print the '-', and then ensure it's negative for the rest of the per-digit code.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: