Division

Post your questions and help other users.

Moderator: Martin

Post Reply
Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Division

Post by Wibbly » 24 Jan 2020 22:01

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?

Horschte
Posts: 56
Joined: 03 Nov 2014 18:00

Re: Division

Post by Horschte » 24 Jan 2020 22:17

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

Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Re: Division

Post by Wibbly » 25 Jan 2020 04:43

Thanks

Post Reply