BenWoodworth / knbt

Kotlin NBT library for kotlinx.serialization
GNU Lesser General Public License v3.0
72 stars 2 forks source link

Strict binary equality for `NbtFloat` and `NbtDouble` #32

Closed BenWoodworth closed 1 year ago

BenWoodworth commented 1 year ago

Currently, two binary different NaN values will return false for equality checks, even though they serialize differently.

Since the NbtTag types represent the serial form, if the serialized value is different, then the serial form should be unequal.

So, these equal functions should compare by the binary representation (with .toRawBits())