Excel Spreadsheet not giving same answer as C# program -


i have trouble following code. not giving same answer in excel c# , i'm sure excel answer correct. have tried change integer values double adding decimal point. please advise.

the excel version

=((1+bz21)*bx21*cg21*(b21*1))-(0.5*bz21*bx21*cg21*((c21*0)+(0*d21))) 

the c# version

voltagevector[rows, 5] = ((1.0 + ki) * rp * c * (ma * 1.0)) - (0.5 * ki * rp * c * ((mb * 0.0 )+ (mc * 0.0))); 

the constants ki, rp, c , ma double precision values.

ki = 0.69999999999999907; rp = 0.0469486290322602; c = 60.0 ma = 2.0; mb = 1.0; mc = 1.0; 

the c# answer

9.5775203225810763 

the excel answer 9.56760000000433

i think something's funny in excel spreadsheet. when tried this, same answer in both c# , excel. believe correct answer 9.577520323. here's screenshot of excel spreadsheet:

enter image description here


Comments

Popular posts from this blog

python - Mongodb How to add addtional information when aggregating? -

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

java - Incorrect order of records in M-M relationship in hibernate -