Page 1 of 1

Division

Posted: 24 Jan 2020 22:01
by Wibbly
I must be missing something simple....

If in a script I have

r = p / r ;

And then show a debug dialogue, r is always an integer. How do I get a decimal result?

Re: Division

Posted: 24 Jan 2020 22:17
by Horschte

Code: Select all

r = 5/2 //r = 2
r = 5/2.0 // r = 2.5
r = 5.0/2 // r = 2.5
r = 5.0/2.0 // r = 2.5

Re: Division

Posted: 25 Jan 2020 04:43
by Wibbly
Thanks