<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi,<BR>
&nbsp;<BR>
I have a question about the rounding algorithm of GMP.<BR>
&nbsp;<BR>
This is part of my code:<BR>
&nbsp;<BR>
mpf_t f;<BR>
char* pchStr = "99999999985";<BR>
mpf_init_set_str (f,pchStr,10);<BR>char *ch = mpf_get_str(NULL,&amp;exp,10,10,f);<BR>
&nbsp;<BR>
&nbsp;<BR>
The reuslt&nbsp;is supposed to be<BR>
ch = "9999999999"<BR>
&nbsp;<BR>
but actually it is "9999999998"<BR>
&nbsp;<BR>
Would anybody tell me why and which rounding algorithm the gmp lib uses?<BR>
&nbsp;<BR>
Regards,<BR>
Emma<BR><br /><hr />把MSN装进手机,更多聊天乐趣等你挖掘! <a href='http://mobile.msn.com.cn/' target='_new'>立刻下载!</a></body>
</html>