Integer to real conversion
-
11sg -
October 1, 2019 at 1:53 PM -
Thread is Unresolved
-
-
it is mandatory to use BITS32 function? BITS function accepts real value and there are 16 inputs and the maximum value that you can get from BITS is 65535.
-
Great question and in short, I don't think there is a direct command for this.
You can convert/round a decimal/float to integer but this is stored as real variable and not a specific integer.
The fact you are using BITS32 will always be required to represented as an integer, but this is stored in a different register.
I think it is like trying to change a pear into an orange, reals and integer registers are treated differently and cannot be mixed and it may purely be based on the max allowable number and how it can be expressed.
However, are you restricted to 32bits, could you manage with 16 bits instead?
I say this as the following is an acceptable command structure:
POINT .test = TRANS(0,BITS(iy,16),BITS(iz,16))
I'd be interested to hear if someone has solution for this for sure...………..