How do I:Simple mathematical issue

Get help using Construct 2

Post » Sat Oct 15, 2016 5:17 am

Hi
I have this operation with this result

3.8 - 3.2 = 5.9999999999999996 :(

But I do think the result is 0.6
Is it possible ?
B
11
S
3
Posts: 44
Reputation: 844

Post » Sat Oct 15, 2016 7:03 am

Image Image
B
23
S
13
G
135
Posts: 871
Reputation: 70,345

Post » Sat Oct 15, 2016 7:18 am

@madspy the error is quite off (as the result is not 6 but 0.6) so I do not think this is the only issue here.
@Angiel I couldn't reproduce the issue on my side, it gives me 0.5999999.. which is close to 0.6 and is to be expected (0.6 is not a finite number in binary) as madspy pointed out (I suggest you round the result to something like the 6th decimal to have the correct result if you happen to have innexactitudes like this)
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sat Oct 15, 2016 6:00 pm

Hi
Thanks for the replies.
B
11
S
3
Posts: 44
Reputation: 844


Return to How do I....?

Who is online

Users browsing this forum: cb130felix, Kermad, Lancifer, mongoose665, piddlyPoo, yiuyiu6666 and 3 guests