10-08-2008 07:53 AM
10-08-2008 08:37 AM - edited 10-08-2008 08:38 AM
Picky, Picky...... You are of course correct..........
Add 0.5, round toward -Infinity.....
10-08-2008 08:50 AM
Just out of curiosity, I wonder why there is no "Round toward zero" (Truncate) function......
To be honest, I was a little startled that the "to unsigned word" conversion function actually does implicit rounding. I understand why it does, it just took me by surprise that it is inherent to the function.
10-09-2008 11:41 AM
tartan5 wrote:Just out of curiosity, I wonder why there is no "Round toward zero" (Truncate) function......
Well, checking if a number is smaller or larger than 0 and doing the appropriate action is pretty simple. It would probably take longer to do the icon than to write the VI itself. Incidentally, you can also try using the Q&R primitive and divide by 1, but I'm not sure what you'll get with a negative input.
10-09-2008 12:43 PM
tartan5 wrote:Just out of curiosity, I wonder why there is no "Round toward zero" (Truncate) function......
There isn't a "round toward zero" but there is 'round to negative infinity'.
10-09-2008 12:44 PM
10-09-2008 01:08 PM
http://www.pldesignline.com/howto/175801189
Good article on different rounding algorithms.........
The "round to nearest" should really be called "Round to nearest even", since that is what it does.....
10-10-2008 01:48 AM
tartan5 wrote:
The "round to nearest" should really be called "Round to nearest even", since that is what it does.....
No, it isn't. It only rounds to the nearest even under these circumstances: