M makeed0 New Member Jul 9, 2024 #1 Mod operator is for integer Number , but in b4a shows wrong answers when we use numbers contain decimal comma : 5 mod 2.6 = 2.4 ( wrong ) i wish fixing it
Mod operator is for integer Number , but in b4a shows wrong answers when we use numbers contain decimal comma : 5 mod 2.6 = 2.4 ( wrong ) i wish fixing it
Erel B4X founder Staff member Licensed User Longtime User Jul 9, 2024 #2 In B4A and B4J mod works with non-integers as well. In B4i there is a similar method named Bit.FMod. You can use the Round method to convert the number to an integer. Upvote 0
In B4A and B4J mod works with non-integers as well. In B4i there is a similar method named Bit.FMod. You can use the Round method to convert the number to an integer.
Sandman Expert Licensed User Longtime User Jul 9, 2024 #3 For whatever it's worth, my desktop calculator agrees with B4A: Upvote 0
Alexander Stolte Expert Licensed User Longtime User Jul 9, 2024 #4 Sandman said: For whatever it's worth, my desktop calculator agrees with B4A: Click to expand... my .net 4.8 too Upvote 0
Sandman said: For whatever it's worth, my desktop calculator agrees with B4A: Click to expand... my .net 4.8 too
LucaMs Expert Licensed User Longtime User Jul 9, 2024 #5 makeed0 said: 5 mod 2.6 = 2.4 ( wrong ) i wish fixing it Click to expand... Wrong? You probably mean that "Mod" should only work with integers, since the decimal result is correct. Erel said: In B4i there is a similar method named Bit.FMod. Click to expand... xui.Mod? (Hint) Upvote 0
makeed0 said: 5 mod 2.6 = 2.4 ( wrong ) i wish fixing it Click to expand... Wrong? You probably mean that "Mod" should only work with integers, since the decimal result is correct. Erel said: In B4i there is a similar method named Bit.FMod. Click to expand... xui.Mod? (Hint)
LucaMs Expert Licensed User Longtime User Jul 9, 2024 #6 LucaMs said: xui.Mod? (Hint) Click to expand... XUI is for... UI! It would be useful to have a similar library for non-UI "stuff" (I'm afraid it already exists and I'm too sleepy right now ? ) Upvote 0
LucaMs said: xui.Mod? (Hint) Click to expand... XUI is for... UI! It would be useful to have a similar library for non-UI "stuff" (I'm afraid it already exists and I'm too sleepy right now ? )