Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

thank you!

yeah, the development was really... chaotic :D

The "0.1 + 0.2" puzzle is a reference to the artifacts of floating point arithmetic. While the correct answer is, obviously, 0.30000000000000005, I figured I should accept 0.3 too, cause otherwise I risk that no one gets beyond that screen :)

I understood the reference, I laughed at the reference.

But I was talking about something else.

These artifacts can be derived procedurally.

The creators of modern development tools have made this process somewhat more complicated:

    var num1: PackedFloat64Array = [0.2, 0.1]

    var summ1: float = num1[0] + num1[1]

    print(summ1) # 0.3

    print(summ1 - (0.2 + 0.1)) # 0

But if we reduce the accuracy of the calculations:


    var num2: PackedFloat32Array = [0.2, 0.1]

    var summ2: PackedFloat32Array = [num2[0] + num2[1]]

    print(summ2[0]) # 0.30000001192093

    print(summ2[0] - (0.2 + 0.1)) # 0.00000001192093