Skip to content

Instantly share code, notes, and snippets.

@mraleph
Created March 11, 2020 14:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mraleph/4455eac700ffba91f484d40f1f3bd9a1 to your computer and use it in GitHub Desktop.
Save mraleph/4455eac700ffba91f484d40f1f3bd9a1 to your computer and use it in GitHub Desktop.
diff --git a/SuperPi_flutter/lib/pi_calculator.dart b/SuperPi_flutter/lib/pi_calculator.dart
index 39faf59..b519f6a 100644
--- a/SuperPi_flutter/lib/pi_calculator.dart
+++ b/SuperPi_flutter/lib/pi_calculator.dart
@@ -30,7 +30,7 @@ class PiCalculator {
double yk1 ;
for (int i = 0; i < k; i++) {
yk1 = (1 - math.pow((1 - yk * yk * yk * yk),(0.25)))/(1 + math.pow((1 - yk * yk * yk * yk),(0.25)));
- ak1 = ak * math.pow((1 + yk1), 4) - math.pow(2, 2 * i + 3) * yk1 * (1 + yk1 + yk1 * yk1);
+ ak1 = ak * math.pow((1 + yk1), 4.0) - math.pow(2.0, (2 * i + 3) + 0.0) * yk1 * (1 + yk1 + yk1 * yk1);
yk = yk1;
ak = ak1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment