From 871d590049d9328bd95f5bc8583cca7998885e19 Mon Sep 17 00:00:00 2001 From: wakgill <76528604+wakgill@users.noreply.github.com> Date: Sat, 9 Jan 2021 16:12:37 -0600 Subject: [PATCH] Create 225.md --- 225.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 225.md diff --git a/225.md b/225.md new file mode 100644 index 0000000..42f3c58 --- /dev/null +++ b/225.md @@ -0,0 +1,33 @@ +--- +layout: forum +title: 'Re: BUG Report: Rounding glitch' +grand_parent: Forum Posts +parent: Bitcoin Forum +nav_order: 225 +date: 2010-07-17 16:06:12 UTC +original: https://bitcointalk.org/index.php?topic=432.msg3769#msg3769 +--- + +# Re: BUG Report: Rounding glitch + +--- + +``` +Re: BUG Report: Rounding glitch +July 17, 2010, 04:06:12 PM + +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) +```