You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
devoncarew opened this issue
Aug 11, 2013
· 3 comments
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.P1A high priority bug; for example, a single project is unusable or has many test failures
UnaryMathInstr::AttributesEqual should compare kind_
right now all UnaryMathInstr instances are considered equal as long as they have the same arguments independently of what they actually compute (so here math.cos(angle) will be replaced with the result of math.sin(angle)).
devoncarew
added
Type-Defect
P1
A high priority bug; for example, a single project is unusable or has many test failures
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
labels
Aug 12, 2013
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.P1A high priority bug; for example, a single project is unusable or has many test failures
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.
The text was updated successfully, but these errors were encountered: