2/15/2016 12:23 PM | |
Joined: 1/4/2013 Last visit: 4/23/2024 Posts: 1107 Rating: (101) |
Jacek, I think that Kahl shown the motivation of this problem. But I still call it problem, instead of a "result of number theory". Because it is a problem. You make a calculation and you need to compare it to a fixed number and what you have to care absolutely is if your calculation can give a result that is representable in a qay where the system can compare. It is like if you need before launching the CMP_R, a sorta of floating point control on one (or both?) the input numbers . That is obviously unacceptable in 2016, it seems a 1990 retail. What I can think is that system, automatically, should apply a sorta of internal range, where somewhere it clamps or approximates automatically the addendums and give the correct result. |
Searching for Siemens used/new equipments ? |
|
2/15/2016 12:51 PM | |
Posts: 5225 Rating: (1185) |
Bold statement.. On the same note.. |
This contribution was helpful to2 thankful Users |
2/15/2016 1:02 PM | |
Joined: 9/23/2005 Last visit: 4/23/2024 Posts: 4522 Rating: (698) |
The thing called IEEE754 has certain restrictions and weaknesses. Whoever attempts to use the thing, should learn these restrictions and weaknesses in order to not be suprised. "The system" is not knowing all fantasies of programmers. If it did, programmers would be superfluous. |
Last edited by: jacek d at: 2/15/2016 1:05:11 PMRegards, |
|
2/15/2016 2:11 PM | |
Joined: 12/16/2012 Last visit: 4/22/2024 Posts: 652 Rating: (130) |
Hi! For the visual types, like myself: |
This contribution was helpful to1 thankful Users |
2/15/2016 2:34 PM | |
Joined: 1/4/2013 Last visit: 4/23/2024 Posts: 1107 Rating: (101) |
What I think is this : if systems makes a MUL_R and it gets as result 1799,99999995678, where clearly the result was 1800, it must round up it. The second statement isn't really involved in automation technology. The actual tech level of PLCs is derived from people who thinks that what we have now is good but not enough, and of course they know that we still have poverty and hunger... [quote] "The system" is not knowing all fantasies of programmers. If it did, programmers would be superfluous. [/quote] I do not call fantasy that 1800 is not geq than 1800. Neither does the Simotion that is IEEE754 compliant, for him 1800 is GEQ than 1800, whatever the calculus comes from. We are just comparing two reals, not two Riemann's Z functions ... It is curious that nobody has still replied to the fact that in Simotion this does not happens... Maybe in motion control you need that 1800 is equal to 1800 if not you have troubles ? Maybe :D |
Searching for Siemens used/new equipments ? |
|
2/15/2016 3:32 PM | |
Joined: 9/8/2009 Last visit: 7/17/2023 Posts: 1410 Rating: (150) |
Hi guys, I read some problems regarding a floating point number, I would like to comment. Floating point is a approximation of the integer number, everytime you convert INT_TO_REAL you loose the exact value. Then if the variables are multiplied,..you further loose the precision. What is all about here, one has multiplied two numbers and it is comparing them at very precisely margin. Sorry to say but this is unpossible, it's a waste of time, in real world nothing will change if the propsed comparator switches after 0.001 tolerance. PID regulators, FIR filters, Kalman,.. all these are just approximations and are widely used, so where the problem is? The engineer has to know that there isn't a absolute precision, that's all. |
This contribution was helpful to4 thankful Users |
2/15/2016 3:38 PM | |
Joined: 9/23/2005 Last visit: 4/23/2024 Posts: 4522 Rating: (698) |
Once again: "The system" is not knowing all fantasies of programmers. The result is as it is.
My Simotion must have been unaware of you revelations... Possibly outdated FW... Excuse me strange variable names. Had no time to alter running machine too much. |
Regards, |
|
This contribution was helpful to2 thankful Users |
2/15/2016 5:43 PM | |
Posts: 5225 Rating: (1185) |
Thank you for sharing this example.. if I could I would rate it twice. |
Follow us on