Taking Care with Integer Arithmetic

LityxIQ interprets integer division using the "/" division sign literally.  Care needs to be taken to ensure you get expected answers.  For example, the code 3/4 will return 0 because this is interpreted as integer division.

To ensure that ratios are correctly computed when using integers as input, at least one of the numerator or denominator needs to be interpreted as a decimal value.  So, the above code can be updated using 3.0/4 or 3.0/4.0 or 3/4.0 to give you the correct decimal output of 0.75.

If the values involved are integer variables, not integer constants, you can use the number_to_decimal function to ensure you have decimal values where needed.  For example:

number_to_decimal([numerator variable]) / number_to_decimal([denominator variable])

Note that the number_to_decimal function works with either integer or decimal data as input, so it will generically work well without needing to know ahead of time whether your input data is integer or decimal.