Re: A Simplified Number System

From: LEE Sau Dan (danlee_at_informatik.uni-freiburg.de)
Date: 11/04/04


Date: 04 Nov 2004 18:20:00 +0800


>>>>> "Sean" == Sean O'Leathlobhair <jwlawler@yahoo.com> writes:

    Sean> An even more important example is SQL which is the dominant
    Sean> database language. In a similar way you may declare types
    Sean> such as DECIMAL(11,2).

    Sean> The implementer of a particular database is free to choose
    Sean> any technique provided it functions correctly.

This is separation of design and implementation.

    Sean> A compliant product could be built using scaled integers
    Sean> but I am unaware of one. But when the hardware has BCD
    Sean> support then this is a good choice and this is very popular.

    Sean> What's wrong with BCD? Those familiar with it think it is
    Sean> the obvious easy solution and most like the way humans do
    Sean> arithmetic (*).

BCD representations are much slower to compute for a computer. You
won't notice the difference for just one or a few operations. But on
a database server serving millions of transactions a day, that can
make a big difference.

Also, the space savings of using scaled integers is tremendous. BCD:
4 bits to represents a decimal digit (log_2 10 = 3.32 bits). That
means 17% of storage space is lost. Again, that's insignificant if
you only consider storing a few thousand digits. But on a database
server with millions time hundreds of digits, that makes a huge
difference. (Using more disk space also means the cache system works
worse, because more space would be accessed.)

So, BCD is a loss both in terms of time and space.

    Sean> (*) This is very important in financial applications.
    Sean> Auditors do things in a particular human way and will call
    Sean> anything else "wrong". It is no good explaining the
    Sean> intricacies of computer arithmetic to them.

I can't so why scaled integers can't satisfy this need.

-- 
Lee Sau Dan                     +Z05biGVm-                          ~{@nJX6X~}
E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee


Relevant Pages

  • Re: A Simplified Number System
    ... > Sean> database language. ... But when the hardware has BCD ... then I would not use BCD, I would use scaled integers. ...
    (sci.lang)
  • Re: A Simplified Number System
    ... > Sean> understand but they would think that it was odd. ... computers usually have good support for BCD ... Cobol dominate and BCD is very common. ... > Sean> Grouping digits into three is still common. ...
    (sci.lang)
  • Re: A Simplified Number System
    ... > Sean> thinks that it is completely illogical. ... Reading long numbers by speaking the digits is common here as well. ... > Sean> significance but nybbles are mostly in the minds of humans. ... But BCD is already obsolete. ...
    (sci.lang)
  • Re: Dynamically create controls in a service
    ... Nicole, I figured it was going to be something very simple. ... Sean ... > With this setup, you can run through your datareader, calling AddWatcher ... >> filewatcher service that will eventually write back to a database, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Create a table with code
    ... Sean wrote: ... for all of the query's in the database. ... to do thru code is create a new table daily off the previous day's backup ... MVP ...
    (microsoft.public.access.queries)