I haven't encountered this until relatively recently so i'm guessing it has to do with this release or the last few.. has anyone else had issues like this? Or maybe my code is wrong?
I'm getting weird long floats with seemingly arbitrary numbers. And also on another more simplified attempt to do this via a Map(), still getting weird conversions when there is no math even involved...
Here is my code:
Code: Select all
a := ""
r := []
y := [0,5,15,25,35,45,50,55,65,75,85,95,100]
for x in y
{
r.Push((2.56 * x) - 128)
a .= r[A_Index] "`n" ; convert to decimal
}
MsgBox a
b := ""
for c in r
b .= ((c + 128) / 2.56) "`n" ; convert back to percentage
MsgBox b
Code: Select all
; output a
-128.0
-115.2
-89.599999999999994
-64.0
-38.399999999999991
-12.799999999999997
0.0
12.800000000000011
38.400000000000006
64.0
89.599999999999994
115.20000000000002
128.0
; output b
0.0
4.9999999999999991
15.000000000000002
25.0
35.0
45.0
50.0
55.0
65.0
75.0
85.0
95.0
100.0
Code: Select all
; output a
-128.0
-115.2
-89.6
-64.0
-38.4
-12.8
0.0
12.8
38.4
64.0
89.5
115.2
128.0
; output b
0.0
5.0
15.0
25.0
35.0
45.0
50.0
55.0
65.0
75.0
85.0
95.0
100.0
