I have a list of numerator and denominator that I want to see if the numerator is divisible by the denominator (i.e. remainder being zero), please see the dataset in R as below:
structure(list(numerator = c(40.77, 38.88, 117.6,
591.9, 592.9, 165.2, 164.1, 568.8, 802.8, 11.4, 862.6, 106.4,
583.872, 4.44, 5.61, 25.4, 3.9, 29.2, 19.2),
denominator = c(0.09,
0.09, 0.1, 0.1, 0.1, 0.1, 0.1, 3.6, 3.6, 3.8, 3.8, 3.8, 0.024,
0.03, 0.03, 0.1, 0.1, 0.1, 0.1)),
class = c("tbl", "data.frame"),
row.names = c(NA, -19L),
.Names = c("numerator",
"denominator")) %>%
mutate(quotient=numerator%/%denominator,
remainder=numerator%%denominator)
I found all rows have remainder calculated, but this should not be, because for example 5.61 should be divisible by 0.1.
I have somehow heard that this is related to issues related to "flowing number", but I only have a faint idea on that, can someone:
explain why this will happen (I am not trained in computer science, sorry for asking something stupid)
how can I fix this?
Thanks!