Description
This can be seen in the solar example, and in the following test case:
import 'dart:math' as math;
void main() {
doMath(true);
for (int i = 0; i < 1000000; i++) {
if (!doMath()) {
print("bad trig results at iteration $i");
doMath(true);
return;
}
}
doMath(true);
}
bool doMath([bool doPrint = false]) {
double angle = math.PI / 2;
double sVal = math.sin(angle);
double cVal = math.cos(angle);
if (doPrint) {
print("sin($angle) = $sVal, cos($angle) = $cVal");
}
return sVal != cVal;
}
I get the following results:
sin(1.5707963267948966) = 1.0, cos(1.5707963267948966) = 6.123031769111886e-17
bad trig results at iteration 2999
sin(1.5707963267948966) = 1.0, cos(1.5707963267948966) = 1.0
I.e. the results go bad after the 3000th iteration of calling the method.