Right --- that doesn't indicate that the code's failing.
The near test is fine.
But we should keep precision in mind if we're trying to do
things like testing for zero returns in the code.
EXPECT_FLOAT_EQ is testing ULPs:
https://en.wikipedia.org/wiki/Unit_in_the_last_place
Sounds complicated. I don't know what algorithm they use
to test, but I could imagine something naive like
shifting 1e-25 up to unit scale and comparing to zero and
seeing that none of the leading digits match. That would
make it like the catastrophic cancellation case you get
with subtraction.
The other complication here is that we're taking double
values and casting them to float. I didn't realize before
that FLOAT meant the C++ float type and there's an equivalent
EXPECT_DOUBLE_EQ.
- Bob
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
stan-dev+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.