Page 1 of 1

[25 Dec 2009] is 1 * 0.9 = 0.9 or 1

Posted: Sat Jun 13, 2020 5:32 pm
by Bugala
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 25 Dec 2009 06:40:27 -0000

as i was making snowball throwin formula, iwas at first using values between 0 and 100, and as i used if x<1 then so,mething and it never happened, i started wondering if i was having bug in that formula (it didnt wrk the way i wanted at that point and i made it totallly different) or is it so in hollywood, that by definition numbers are whole numbers and not floating numbers.

If they by definition are whole numbers ie. 1 * 0.9 = 1, then how do i set them to be floating numbers, means: 1 * 0.9 = 0.9?

And which one is faster, or is there any significant difference in using either 1 * 0.9, or using ((100x1) *(0.9 X 100))/100?

[28 Dec 2009] Re: is 1 * 0.9 = 0.9 or 1

Posted: Sat Jun 13, 2020 5:32 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 28 Dec 2009 21:39:47 +0100
as i was making snowball throwin formula, iwas at first using values between 0 and 100, and as i used if x<1 then so,mething and it never happened, i started wondering if i was having bug in that formula (it didnt wrk the way i wanted at that point and i made it totallly different) or is it so in hollywood, that by definition numbers are whole numbers and not floating numbers.

If they by definition are whole numbers ie. 1 * 0.9 = 1, then how do i set them to be floating numbers, means: 1 * 0.9 = 0.9?
All Hollywood numbers are 64-bit floating point numbers. So 1 * 0.9 is indeed 0.9.
And which one is faster, or is there any significant difference in using either 1 * 0.9, or using ((100x1) *(0.9 X 100))/100?
No, such small calculations will execute very fast.