Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Houshalter
on Aug 28, 2013
|
parent
|
context
|
favorite
| on:
He got 1%, we can't hire him
Maybe this is a stupid question, but wouldn't that always return true? (a/b)*b just cancels out the b right? Unless there is weird floating point stuff going on.
Deestan
on Aug 28, 2013
|
next
[–]
There's
not
floating point stuff going on, that's why it works. :)
a and b are ints, so a/b is truncated (rounded down) before applying *b.
ajanuary
on Aug 28, 2013
|
prev
[–]
It's integer maths. For example: a = 10, b = 3 10/3 = 3 3 * 3 = 9 9 != 10
Consider applying for YC's Spring batch! Applications are open till Feb 11.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: