Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I multiply floating point values (decimals) in ROBOLAB 2.9?

0
Posted

How do I multiply floating point values (decimals) in ROBOLAB 2.9?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123