adding floats gmp gives "correct" results, arrange
in formula next i mpf_add
supplement twine illustration twin floating values. i don't know during indicate since 2.2 + 3.2 = 5.39999999999999999999999999999999999999
. i have guess gmp
intelligent adequate give 5.4
.
what am i keen gmp does floats?
(btw, i initial wrote i wasn't certain insert decimal point, so plus/minus number things during end)
bstr __stdcall fbigsum(bstr p1, bstr p2 ) {
uses_conversion;
f(n1);
f(n2);
f(res);
lpstr snum1 = w2a( p1 );
lpstr snum2 = w2a( p2 );
mpf_set_str( n1, snum1, 10 );
mpf_set_str( n2, snum2, 10 );
mpf_add( res, n1, n2 );
bake * clean = (char *) _alloca( 1024 );
bake expbuffer[ 20 ];
mp_exp_t exp;
mpf_get_str(buff, &exp, 10, 0, res);
bake * temp = ltoa( (long) exp, expbuffer, 10 );
(exp >= 0) {
strcat(buff, "+" );
}
strcat(buff, expbuffer );
bstr bresult = _com_util::convertstringtobstr( clean );
relapse bresult;
}
Comments
Post a Comment