svenvc / ston

STON - Smalltalk Object Notation - A lightweight text-based, human-readable data interchange format for class-based object-oriented languages like Smalltalk.
MIT License
135 stars 32 forks source link

Floating point numbers not materializing correctly #34

Closed webwarrior-ws closed 2 years ago

webwarrior-ws commented 2 years ago

Some floats are have different values after materialization due to loss in precision when doing arithmetic operations in STONReader. Some examples: 0.022999999999999854, 4.999999999999996, Float fmin. This should not occur and all values must be exactly the same after serializing and materializing.

svenvc commented 2 years ago

Please see https://github.com/svenvc/ston/commit/a9959114c3036aad1dd5c327a5b8ac3309e4c3e5

I added further comments to your PR