I am finding it a little long winded to separate a decimal from its integer and must have missed something. This gives me more than I started with, Great for a bank or the tax man's computer.
I can either cast to an int variable or Floor() with odd results.
I actually want to obtain the 0.6 or whatever accurately. I have achieved it as shown at the bottom but wow.
I can either cast to an int variable or Floor() with odd results.
I actually want to obtain the 0.6 or whatever accurately. I have achieved it as shown at the bottom but wow.
B4X:
Dim w,v as Float
Dim z, y as int
w = 12.6
z = Floor(w)
Log(z) = 12
'or I could cast to int with the same result
y = w = 12
v = w - z
Log(v) = 0.6000003814697266
:) Log(z + v) = 12.6000003814697266 :)
I could Floor( (v - w) * 10 ) /10 = 0.6
Last edited: