Github user dbtsai commented on the pull request:

    https://github.com/apache/spark/pull/1425#issuecomment-49803403
  
    I also noticed that it will be suffering when comparing against 0.0. As 
@srowen pointed out, it's meaningless to comparing against 0.0 (or a really 
small number) with relative error. However, people may just want to write 
unittest using relative error for even comparing those small numbers. So I 
purpose the following APIs.
    `a ~== b +- eps` for relative error, and when a or b near zero, let's say 
1e-15, it falls back to absolute error.
    `a === b +- eps` which is already in scalatest 2.0 for absolute error, but 
since we don't use scalatest 2.0 yet, we build the same APIs in mllib for 
absolute error.



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to