MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/shittyprogramming/comments/917gu1/how_do_i_math/e2w0l0h/
r/shittyprogramming • u/[deleted] • Jul 23 '18
8 comments sorted by
View all comments
Show parent comment
32
(X/5)*5 = X
Only if X is divisible by 5.
21 u/Mildan Jul 23 '18 Pretty much, it's a rounding technique to remove trailing digits, or digits altogether.For example 18/5 *5 would equal 15 when done with integers, not 18.
21
Pretty much, it's a rounding technique to remove trailing digits, or digits altogether.
For example 18/5 *5 would equal 15 when done with integers, not 18.
View all comments
Show parent comment
32
u/dmitriy_shmilo Jul 23 '18
Only if X is divisible by 5.