Trying to create a 3 digit random number, from 50 to 175 (to emulate a HR value for testing in Eclipse.
Anyway, check this out. Weird. The decimal portion of "b" should simply be the last 3 digits of the integer portion of "a". It never is. Any ideas?
var a = Math.rand().toFloat();
System.println("A: " + a);
var b = a / 1000f;
System.println("B: " + b);
var c = b.toNumber();
System.println("C: " + c);
var d = ((b - c.toFloat()) * 1000f).toNumber()/8+50;
System.println("D: " + d + "\n");
=========================================
A: 1796216192.000000
B: 1796216.250000
C: 1796216
D: 81
A: 1283134080.000000
B: 1283134.125000
C: 1283134
D: 65
A: 1900381440.000000
B: 1900381.500000
C: 1900381
D: 112