Floating point really is a world of hurt when it comes to stuff like this. What might be appropriate is adding a `Precision` field to the `Attribute` which will then change the behaviour of this function.