Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
xxs
on March 24, 2022
|
parent
|
context
|
favorite
| on:
Swapping two Numbers without Temporary Variables
you cant swap doubles like that though... b/c if any of them is a NaN or an infinity, it breaks down.
It works for integers (and pointers)
charcircuit
on March 24, 2022
[–]
It also breaks due to rounding even if you don't have NaN or Inf.
Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
It works for integers (and pointers)