Github user dbtsai commented on the pull request:
https://github.com/apache/spark/pull/1425#issuecomment-49221370
@mengxr Scalatest 2.x has the tolerance feature, but it's absolute error
not relative error. For large numbers, the absolute error may not be
meaningful. With `===`, it will return false even the different is only one
unit of least precision (ULP), and it often happens when running the unittest
under different architecture of machine. For example, ARM and X86 may have
different numerical rounding , and we don't run any test other than X86. C++
boost has their numerical `===` test with the relative error for this reason.
I probably can add method called `~=` and `~==` method for `Double`, and
`Vector` type using implicit class, and `~==` will raise the exception for the
message purpose like `===` does.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---