Repository navigation
snap7.util.get_real() delivers inaccurate value #371
|
Hello
Do i have to accept this or am I doing something wrong? Thanks in advanced. |
Answered by
swamper123
Jun 24, 2022
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 |
0 replies
Answer selected by
joerggm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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