Keeping accuracy when taking decimal to power of integer
问题 My code is as follows (I have simplified it for ease of reading, sorry for the lack of functions): #include <stdio.h> #include <string.h> #include <math.h> #include <iostream> #include <iomanip> #include <fstream> #include <time.h> #include <stdlib.h> #include <sstream> #include <gmpxx.h> using namespace std; #define PI 3.14159265358979323846 int main() { int a,b,c,d,f,i,j,k,m,n,s,t,Success,Fails; double p,theta,phi,Time,Averagetime,Energy,energy,Distance,Length,DotProdForce, Forcemagnitude