Bitcoin Forum
December 08, 2016, 12:03:28 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: BUG Report: Rounding glitch  (Read 1067 times)
The Madhatter
Hero Member
*****
Offline Offline

Activity: 490


My avatar pic says it all


View Profile
July 17, 2010, 02:10:03 PM
 #1

Check this out...

I just installed 0.3.1 on two different machines and moved one bitpenny (0.01):

-= Before the transfer =-

[bitcoind@box1 ~]$ ~/bin/bitcoind getinfo
{
    "balance" : 1.150000000000,
    "blocks" : 68717,
    "connections" : 6,
    "proxy" : "",
    "generate" : false,
    "genproclimit" : -1,
    "difficulty" : 181.5432893640505
}

[bitcoind@box2 ~]$ ~/bin/bitcoind getinfo
{
    "balance" : 0.000000000000,
    "blocks" : 68717,
    "connections" : 22,
    "proxy" : "",
    "generate" : false,
    "genproclimit" : -1,
    "difficulty" : 181.5432893640505
}

-= AFTER the transfer =-

[bitcoind@box1 ~]$ ~/bin/bitcoind getinfo
{
    "balance" : 1.139999999999,
    "blocks" : 68717,
    "connections" : 10,
    "proxy" : "",
    "generate" : false,
    "genproclimit" : -1,
    "difficulty" : 181.5432893640505
}

[bitcoind@box2 ~]$ ~/bin/bitcoind getinfo
{
    "balance" : 0.010000000000,
    "blocks" : 68717,
    "connections" : 20,
    "proxy" : "",
    "generate" : false,
    "genproclimit" : -1,
    "difficulty" : 181.5432893640505
}

I personally think it is a display problem, but I can't be sure.. strange, no?

Both machines are running FreeBSD 7.2/amd64.
1481198608
Hero Member
*
Offline Offline

Posts: 1481198608

View Profile Personal Message (Offline)

Ignore
1481198608
Reply with quote  #2

1481198608
Report to moderator
1481198608
Hero Member
*
Offline Offline

Posts: 1481198608

View Profile Personal Message (Offline)

Ignore
1481198608
Reply with quote  #2

1481198608
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481198608
Hero Member
*
Offline Offline

Posts: 1481198608

View Profile Personal Message (Offline)

Ignore
1481198608
Reply with quote  #2

1481198608
Report to moderator
1481198608
Hero Member
*
Offline Offline

Posts: 1481198608

View Profile Personal Message (Offline)

Ignore
1481198608
Reply with quote  #2

1481198608
Report to moderator
satoshi
Founder
Sr. Member
*
qt
Offline Offline

Activity: 364


View Profile
July 17, 2010, 04:06:12 PM
 #2

It must be a rounding error when getinfo converts to floating point to return the JSON-RPC result.  The only place where it uses floating point to represent money is returning a value in JSON-RPC.

1.139999999999 is longer than bitcoin can internally represent.

internally, it could only be:
1.13999999 or
1.14000000

1.139999999999 is much much closer to 1.14000000 than 1.13999999, so it must be 1.14000000.

The code is this:
(double)GetBalance() / (double)COIN.

(I can't think of an easy way to fix it at the moment)
The Madhatter
Hero Member
*****
Offline Offline

Activity: 490


My avatar pic says it all


View Profile
July 17, 2010, 05:05:40 PM
 #3

I figured it was a bug with the display. I spent the bitpenny back the other direction and the balance on the first box returned to its initial state. Tongue
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!