How do I multiply floating point values (decimals) in ROBOLAB 2.9?
The multiply block does not preserve the floating point status of its input factors (the digits to the right of the decimal point). For example, if you store the floating point number 1.68 in a container and then use the multiply container block to multiply it by 10, the resulting container value is 20 because 1.68 is rounded up to 2 before the computation occurs. To multiply decimals, use the ‘Evaluate Expression’ and ‘Fill Container w/ Variable’ blocks from the container menu. • Use the ‘Evaluate Expression’ block to declare variables as floating point numbers with decimal values. • Then, use the ‘Fill Container w/ Variable’ block to type in the multiplication formula of the variables and store the result of that formula in a regular container. • Note that as soon as you store that result in a regular container, it is rounded down into an integer. However, the floating point values were used for the calculation itself. (This means that, for example, if you declare floating point vari
Related Questions
- I want to exchange data with an external source, but the problem is that floating point values are passed as little-endian (reverse storage order). How can I set things right in my program?
- How do I fill a container with a floating point value (decimal) in RoboLab 2.9?
- How do I multiply floating point values (decimals) in ROBOLAB 2.9?