Here is an issue with ROUNDI : this instruction applies currently only to reals, not to integer. This is an issue because it means that when the user has to enter data in a program including the ROUNDI instruction he has also to specifically enter numbers with a decimal separator. Otherwise there could be an error message "Invalid input type for this operation" if ROUNDI is applied to the result of a calculation that happens to be integer.
For example, let's look at the simple program below just for illustration:
Code: Select all
001 LBL 'TST' 002 RCL+X 003 SQRT 004 ROUNDI 005 END
If you enter 3 XEQ 'TST' it will return correctly 2.
But if you enter 2 XEQ 'TST' you'll get an "Invalid input type for this operation" error message because 2+2=4 and the square root of 4 is 2 which is considered as an integer to which ROUNDI cannot be applied.
The only way to get a result for 2 is to enter 2. XEQ 'TST' so SQRT(2.+2.) will return 2. which is a valid type for ROUNDI.
For consistency and ease of use ROUNDI should not return an error when applied to integers (same as IP which works correctly with integers).