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.
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.
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'.
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.....
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: