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?
[25 Dec 2009] is 1 * 0.9 = 0.9 or 1
- airsoftsoftwair
- Posts: 5943
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[28 Dec 2009] Re: is 1 * 0.9 = 0.9 or 1
Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 28 Dec 2009 21:39:47 +0100
All Hollywood numbers are 64-bit floating point numbers. So 1 * 0.9 is indeed 0.9.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?
No, such small calculations will execute very fast.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?