Hi there, first off all I am making an code for a store that just counts up and down and add everything to a total.
The program
If cobble stone ([1] in both tables) goes up to 0,4 and back to 0 it returns the number 2.7755576E-17, and I am not quite sure why.
And thats why I am here
Thanks in advance for the help
Engineer
Note: I think the program can be written more efficient and stuff, but as long it works its fine
0
Small numbers returning 2.77E-17
Started by Engineer, Mar 06 2013 09:14 AM
4 replies to this topic
#1
Posted 06 March 2013 - 09:14 AM
#2
Posted 06 March 2013 - 10:03 AM
2.7755576E-17 is the same as 2.7755576*10^-17, or 0.0000000000000000027755576.
Im not sure why it does this but it is easy enough to fix, just round it up
so imagine i = 0.000007
then math.floor(i) is 0
should fix it right?
Im not sure why it does this but it is easy enough to fix, just round it up
so imagine i = 0.000007
then math.floor(i) is 0
should fix it right?
#3
Posted 06 March 2013 - 10:05 AM
Wow, why didnt I thought about that? Thanks man
#4
Posted 06 March 2013 - 10:08 AM
that number sounds like some sort of memory position? did you set a variable to a function anywhere, please forgive meh noobiness but you know, its a suggestion.
#5
Posted 06 March 2013 - 10:10 AM
samdeman22, on 06 March 2013 - 10:08 AM, said:
that number sounds like some sort of memory position? did you set a variable to a function anywhere, please forgive meh noobiness but you know, its a suggestion.
ok, thats not valid anymore, now I remember about scientific notation on computers, try doing large sums in google, it usually comes up with a similar answer.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users