I'm not going to point you directly at the solution as this is more of an issue with the way you're trying to solve this. But it's not because the result of your division is comprised between 1.0 and 2.0 that a number is a multiple of the other, especially with floating point numbers. You might want to have a look at the math package, specifically the Mod function.
To give you another example, 15.0 / 10.0 is 1.5, so it passes your condition, though 15 is not a multiple of 10. Hope this helps Le mar. 23 nov. 2021 à 19:19, Денис Мухортов <muhortovdeni...@gmail.com> a écrit : > I want to collect subsets of numbers in increments of 10. All numbers pass > if correctly, except 32.5. The result of its division is 1.625. But for > some reason it passes if twice, I added different numbers, all work > correctly > https://go.dev/play/p/kdJu-PBsbpC > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/07dcc809-6d21-4e60-9a0e-95514719bb4en%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/07dcc809-6d21-4e60-9a0e-95514719bb4en%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAL4P9zx4Kze2mW37gQjRY6FJ7-9Psq%2BH3z3N%2Bg8KN2c0VqJGbg%40mail.gmail.com.