Minus sign in a Zero balance

General discussion on all other topics under the sun.

Moderator: Renato

Post Reply
ginnes
New MMEX User
Posts: 7
Joined: Sun Mar 02, 2014 1:01 pm
Are you a spam bot?: No

Minus sign in a Zero balance

Post by ginnes »

I have 6 Term Accounts and 2 Current Accounts in one mmb file. I have transferred the balance of two of the term accounts to one of the current accounts leaving me with a 0.00 balance in one of the accounts and a -0.00 in the other.The 0.00 balance shows up on the Home page as £0.00 in black and the -0.00 balance shows up as £-0.00 in red, can anyone explain why the minus sign appears in one of these balances. Both of these accounts have only a few entries and I have checked them both for errors.I am using Desktop version 1.2.7 on Windows 10.

I am a bit disapointed, this post has had over a 100 views so it must sound interesting, but not one reply.  If it is in the wrong forum perhaps someone could comment please.
User avatar
Daddy Peacebucks
Senior MMEX User
Posts: 33
Joined: Mon Nov 23, 2009 11:18 am
Are you a spam bot?: No

Re: Minus sign in a Zero balance

Post by Daddy Peacebucks »

ginnes wrote:I have 6 Term Accounts and 2 Current Accounts in one mmb file. I have transferred the balance of two of the term accounts to one of the current accounts leaving me with a 0.00 balance in one of the accounts and a -0.00 in the other.The 0.00 balance shows up on the Home page as £0.00 in black and the -0.00 balance shows up as £-0.00 in red, can anyone explain why the minus sign appears in one of these balances. Both of these accounts have only a few entries and I have checked them both for errors.I am using Desktop version 1.2.7 on Windows 10.

I am a bit disapointed, this post has had over a 100 views so it must sound interesting, but not one reply.  If it is in the wrong forum perhaps someone could comment please.
This is a problem that has existed in computers literally (and I mean literally) for decades. I remember this issue being brought up with Lotus 1-2-3 (a spreadsheet program) on the IBM PC back in the early 1990's. Here's one reference to the problem: PC Magazine, August 1991 "Eliminating the Negative Zero"

Basically the issue is that computers use binary (base 2) math for calculations, but decimal (base 10) is used for displaying numbers. The two systems are close, but not identical, so tiny discrepancies occur when converting back and forth between binary and decimal. In the real world, when you display the results of the calculations, you round the number to match the precision of your data. With financial calculations, this is normally two digits after the decimal point (maybe a few more digits if you are calculating interest rates). With most numbers, the rounding corrects the errors so that the decimal value is indistinguishable from the binary value. But when you deal with ZERO, if the binary calculations result in a value that is even a tiny bit less than zero, it will still result in a "negative zero" result.

Also, if I remember correctly, while programs could use specialized decimal functions when performing the calculations (which would eliminate the problem), such functions can significantly slow down the processing speed, and for financial calculations, such a trade-off is rarely needed. However for scientific calculations, where such precision may be required, then sometimes it may be worth slowing things down for the sake of accuracy. Now in theory, the minor discrepancies between binary and decimal math could cause problems in financial calculations if the amount of money is large enough (because of the much greater number of digits). However, if you have that amount of money, please contact me and I'll personally white out the negative sign on all of your zeroes (for a proper fee of course! :mrgreen:)

Yes the program could probably correct the display (and I agree it's mildly annoying), but it won't affect your financial calculations, so I'd suggest you just accept it and worry about other stuff.

I hope this answers your question.

DP

P.S. For more technical information about this rounding issue, check out the following Wikipedia article: https://en.wikipedia.org/wiki/Signed_zero
MMEX v1.6.2 [portable 64-bit]
(certified vegan and now with EXTRA gluten!)
User avatar
Daddy Peacebucks
Senior MMEX User
Posts: 33
Joined: Mon Nov 23, 2009 11:18 am
Are you a spam bot?: No

Re: Minus sign in a Zero balance

Post by Daddy Peacebucks »

Daddy Peacebucks wrote:
Yes the program could probably correct the display (and I agree it's mildly annoying), but it won't affect your financial calculations, so I'd suggest you just accept it and worry about other stuff.
I'm going to revise my previous suggestion: If the negative zero problem can't be "fixed", at least have MMEX display a negative zero without displaying that value in red on the Home Page. That way it won't stand out as much and it will be easier to ignore.


(Moderator: If you want, I can put this post in the Feature Requests section, but I felt it also made sense to place it in this thread.)
MMEX v1.6.2 [portable 64-bit]
(certified vegan and now with EXTRA gluten!)
User avatar
Daddy Peacebucks
Senior MMEX User
Posts: 33
Joined: Mon Nov 23, 2009 11:18 am
Are you a spam bot?: No

Re: Minus sign in a Zero balance

Post by Daddy Peacebucks »

Did v1.3.3 fix this issue? Or is this an accidental byproduct of the database update?

I finally updated from v1.2.7 to v1.3.3 and the negative zero on one of my accounts is now just a "normal" 0.00.
MMEX v1.6.2 [portable 64-bit]
(certified vegan and now with EXTRA gluten!)
Post Reply