falling down auto type cast float to integer
Piles of Wires
Posts: 8
Odd thing...
an_Int = a_Float*255.0
an_Int = 255.0
Compiler says:
ERROR: File.axs(1): C10512: Cannot convert type [FLOAT] to [INTEGER]
ERROR: File.axs(2): C10533: Illegal assignment statement
WARNING: File.axs(2): C10571: Converting type [FLOAT] to [INTEGER]
So my question is: Why does it fail on the first conversion not the second? and how do I fix it?
an_Int = a_Float*255.0
an_Int = 255.0
Compiler says:
ERROR: File.axs(1): C10512: Cannot convert type [FLOAT] to [INTEGER]
ERROR: File.axs(2): C10533: Illegal assignment statement
WARNING: File.axs(2): C10571: Converting type [FLOAT] to [INTEGER]
So my question is: Why does it fail on the first conversion not the second? and how do I fix it?
0
Comments
A TYPE_CAST() will "cut off" the values after the comma