snap7.util.get_real() delivers inaccurate value #371
-
Hello
Do i have to accept this or am I doing something wrong? Thanks in advanced. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You haven't done something wrong. This is the nature of floating point numbers. ( Try out this in your pythonconsole: >>> 1.2-1.0
0.19999999999999996
>>> For more infos about this error: read these python docs |
Beta Was this translation helpful? Give feedback.
You haven't done something wrong. This is the nature of floating point numbers. (
Siemens said, you can be 6 digits accurate on a PLC.
Then you got snap7 and pyton-snap7 in between and the floatingpoint error exists.
Try out this in your pythonconsole:
For more infos about this error: read these python docs