What happened?
halfblinddado
Posts: 59
I was doing some floating point calculations and getting the results I expected then it started giving me strange results and then all zero's?
Is it maybe a harware problem?
[
x1 := 10.0
y1 := 10.0
x2 := 10.0
y2 := 10.0
lfy := f32.Fsub(x1, x2)
lfx := f32.Fsub(y1, y2)
z := f32.atan2(lfy, lfx)
Term.str(FS.FloatToString(lfx))
Term.str(String(13))
Term.str(FS.FloatToString(lfy))
Term.str(String(13))
Term.str(FS.FloatToString(z))
Term.str(String(13))
]
Is it maybe a harware problem?
[
x1 := 10.0
y1 := 10.0
x2 := 10.0
y2 := 10.0
lfy := f32.Fsub(x1, x2)
lfx := f32.Fsub(y1, y2)
z := f32.atan2(lfy, lfx)
Term.str(FS.FloatToString(lfx))
Term.str(String(13))
Term.str(FS.FloatToString(lfy))
Term.str(String(13))
Term.str(FS.FloatToString(z))
Term.str(String(13))
]
Comments
BTW, depending on which serial driver you're using the following:
Could be written:
or if you're using PST:
Another BTW, when posting code, it's a lot easier for us to read it if you use code tags. Here's a link to a tutorial.