How to multiply variables with calculated values below one

Post your questions and help other users.

Moderator: Martin

Post Reply
Joost van Gils
Posts: 19
Joined: 20 Mar 2014 09:00

How to multiply variables with calculated values below one

Post by Joost van Gils » 22 Jul 2014 13:42

This question must have been asked before, but I can't find it anywhere on the forum: how can I multiply variables that hold values below one and simply get the outcome? P.e.: a=1/5; b=2/3;c=a*b....?
Is There a simple way to do this without multipying by 100 or 1000 or 10000 etc. ? It seems that all variables are rounded before multiplying.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: How to multiply variables with calculated values below o

Post by Martin » 23 Jul 2014 18:20

Hi,

Automagic uses integer math when both operands are integers. You can do floating point math by using numbers with a decimal point:
a=1.0/5.0; b=2.0/3.0; c=a*b

Regards,
Martin

Post Reply