Skip to content

Instantly share code, notes, and snippets.

@mraleph
Created March 11, 2020 14:30
Embed
What would you like to do?
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