Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
Houshalter
12y ago
0 comments
Share
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.
0 comments
default
newest
oldest
Deestan
12y ago
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
12y ago
It's integer maths. For example: a = 10, b = 3 10/3 = 3 3 * 3 = 9 9 != 10
j
/
k
navigate · click thread line to collapse