There is no issue here. A binary floating point type cannot represent accurately decimal numbers. You should use NumberFormat to convert a floating point number to a string.
I explained in
this post that Log can return a wrong value with Float values because these values are converted to double, which is not a neutral operation. NumberFormat has the same problem as it seems to be based also on NumberToString.
In Java:
float F = 0.123456789f;
Log.i("B4A", "F=" + F);
Log.i("B4A", "F*F=" + (F*F));
double dFF = F*F;
Log.i("B4A", "dFF=" + dFF);
-> F=0.12345679
-> F*F=0.015241579
-> dFF=0.01524157915264368
If I compute the square root of 0.01524157915264368 (dFF) with my Windows Calc, I get 0.12345679062993529802282045525767, which is close to the value returned by the Java Log function for F. If I compute the square root of 0.015241579 (F*F), I get 0.12345679001172839501117129625054, which is even closer. So the Java Log seems to return the internal value reliably and we can see that converting to double introduces a very slight difference.
Now in Basic4Android v3.82:
Dim F As Float = 0.123456789
Log("F=" & F)
Log("F*F=" & (F*F))
Dim dFF As Double = F*F
Log("dFF=" & dFF)
-> F=0.12345679104328156
-> F*F=0.01524157915264368
-> dFF=0.01524157915264368
The returned values for F and F*F are different from the previous results. I can clearly see that F*F is converted to double as it returns the same value as dFF.
With F = 0.12345679104328156, as reported by the B4A Log, I should get something close to 0.01524157925470448601602121343603 for F*F but it's not the case. So the Log function does not reflect the internal value reliably.
EDIT for quick readers: this post is not about the accuracy of Float values. It is about the difference between the value stored internally (which is not accurate as you can see above; neither Java nor B4A return 0.123456789 for F) and the value returned by Log or NumberFormat.
For numbers with a few decimals, like 3.1 or 0.123, having Log returning 3.1 or 0.123 is not exact as these numbers are not stored internally with this accuracy. But returning 3.0999999046325684 or 0.12300000339746475 is disturbing as these numbers are obviously not float values (too many decimals). If we round them with the precision of a float value (32 bits, about 7 significant numbers), then the closer results are 3.1 and 0.123. And, as I proved above, converting float numbers with a lot of decimals to double adds the unaccuracy of the float type to the unaccuracy of the double type. So, in all cases, IMHO, values should not be converted.