Re: A Simplified Number System

From: Wiktor S. (look_at_my.sig)
Date: 11/02/04


Date: Tue, 2 Nov 2004 17:28:06 +0100


> Sean> What are your "fixed point numbers"? The ones most familiar
> Sean> to me are BCD.
>
> Fixed point is as opposed to floating point. Recall that a floating
> point number consists of 2 (signed) parts: mantissa and exponent.
> With fixed point, I mean the exponent is always fixed. So, you only
> need to store the mantissa. The exponent is implicit. You would of
> course use exponents that are (negative) powers of 10 for financial
> applications. A reasonable way to represent the mantissa in binary is
> to use 2's complement form.

It's like keeping all prices in cents instead of dollars and it's fractions
(or whatever currencies you use). I think it's the best solution. Normal
integers and normal arithmetics. You only need to display them correctly. No
weird BCD, no special structures.

-- 
Azarien
e-mail: wswiktor&poczta,fm


Relevant Pages

  • Re: fixed-point
    ... First ask yourself "what is the purpose of a floating point number?" ... Adjust the numbers so that both numbers have the same exponent ... The 16 in the macro refers to the multiplication factor. ... function call in so far as the paramter conversion is concerned. ...
    (comp.lang.c)
  • Re: Fastest way to compute floating point log and exp
    ... So far I've found that with a few tables and floating point MUL and ADD ... You didn't mention how much precision you need, nor for that matter what the log base is to be. ... bit easier than other bases because the floating point exponent is the integer portion of the log. ...
    (comp.arch.fpga)
  • Re: Invalid results from exp2 function (C math library)
    ... You are asking your floating point library to do something it isn't ... In my specific case I only take exponent of negative values. ... I expect that some intermediate calculation hurled ... It depends on your compiler. ...
    (comp.lang.c)
  • Re: representations
    ... The exponent is the exponent, ... IEEE standard floating point number use something very similar to scientific notation. ... There is one exception to this rule, zero, so zero is represented specially by all bits zero. ... Finally there are a few special representations for infinity, not a number, and what are called denormalised numbers, but you can ignore those for now. ...
    (comp.lang.c)
  • Re: Favourite methods for scanning/parsing input data?
    ... Limit-checking a few dozen input floating-point numbers can add ... No floating point subtraction (which involves ... compare the exponent part of the value with the exponent part of the ... compare the mantissa parts. ...
    (comp.arch.embedded)