Negative offset when shifting an AbsoluteDate
When computing
AbsoluteDate reference = new AbsoluteDate(2019, 10, 11, 20, 40, 1.6667019180022178E-7,
TimeScalesFactory.getTAI());
double dt = FastMath.scalb(6596520010750484.0, -39);
AbsoluteDate shifted = reference.shiftedBy(dt);
The result shifted instance has an epoch set to 624110399 and an offset set to -1.6926787795898916E-13 because the closest IEEE754 normal number computed when summing the seconds is before a whole second.
This breaks AbsoluteDate
algorithms later on because they rely on the fact the offset is between
0.0 included and 1.0 excluded. For example shifted.shiftedBy(Precision.EPSILON)
is considered equal to shifted
instead of being a few femtoseconds after it.
This is the root cause of bug #935 (closed).