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
fkleon
added
duplicate
Indicates similar issues or pull requests
question
Indicates that an issue or pull request needs more information
labels
Mar 2, 2022
@cnmade You need to select the precision based on your application's requirements. I assume in your case you'd want a low(e) precision- maybe of 3 significant digits - so that the result is rounded correctly:
voidmain() {
double i =7.0*1.15;
print(i.toStringAsFixed(3)); # prints 8.05
}
Note that the original result 8.049999999999999 only has 16 digits precision, so when asking for 19 significant digits you're getting a more precise (longer) value as per Dart's implementation of 64 bit double-precision floating point numbers.
with the math_expressions library, we type
the calc result was
why it not return 8.05
The text was updated successfully, but these errors were encountered: