SLC Math Wierdness

In using FP's, you can usually mix integers in the equations, but ALWAYS have a FP as a result word. But yes... "0" and "0.0" are two very different things!
 
This is interesting. I have never had this kind of problem with roundoff and conversion in PLCs; just lucky I guess! I have written simulation code that checks results around zero, and sets them to zero exactly if the absolute value of the result is smaller than some value sigma (with sigma set something like 1E-5 or 1E-6).

This problem has been around ever since computers began using 1's and 0's. When I was in school, one instructor showed us a famous problem (in quantization anyway) that has a perfectly obvious solution set of 0 and 2. Change the constants in the equation just slightly, and it blows up.
 

Similar Topics

We are getting a fault...... Math Overflow Trap S:5/0 = 1 Apparently we are getting a value greater than 32767 or less than -32766. If...
Replies
6
Views
7,850
I am using the cpt instruction on a slc 5/05 i have used this before to add, subtracted and multiply but not to divid. now when i enter the...
Replies
3
Views
3,712
I need to multiply a float (0 - 36) by 1,000,000 and then totalize this. What I am thinking of doing is using the 32b math operations, but I'm not...
Replies
10
Views
2,139
Hello all, As the topic name says I am having an issue with math. I am using the CPT function with an equation of ((N7:60-N7:61)|N7:60)* 100) and...
Replies
7
Views
3,495
I recently had a SLC 5/04 processor fault out due to a math error. The overflow trap and zero bits were both set. I was finally able to locate it...
Replies
5
Views
5,601
Back
Top Bottom