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