[manticore] Decimal numbers
Jeff Mrochuk
jmrochuk at ualberta.ca
Thu Jun 20 11:46:07 EDT 2002
Also the top bit of the integer part is a sign bit.
So the MSB of the whole 16 bit number is sign
----- Original Message -----
From: "Jeff Mrochuk" <jmrochuk at ualberta.ca>
To: <manticore at icculus.org>
Sent: Thursday, June 20, 2002 3:39 AM
Subject: Re: [manticore] Decimal numbers
> We're using regulary binary fractions
>
> ie 1/2(0.5) => 0.1
> 1/4(0.25) => 0.01
> 1/8(0.125) => 0.001
> 1/16(0.0625) => 0.0001
> 1/32(0.03125) => 0.00001
> 1/64(0.015625) => 0.000001
> so 0.345 would be 0.01011 or so
>
>
>
> ----- Original Message -----
> From: "Ling Andrew Chaang" <acling at ee.ualberta.ca>
> To: <manticore at icculus.org>
> Sent: Wednesday, June 19, 2002 3:22 PM
> Subject: [manticore] Decimal numbers
>
>
> > Jeff or Benj,
> >
> > For debugging purposes,
> >
> > we're representing decimal numbers with a 10 bit integer part and 6 bit
> > decimal part...
> >
> > The integer part is obvious in translating to binary, as for the decimal
> > part, how do you want it represented...
> >
> > for example, how do you want 0.345 translated into a 6-bit number
> >
> > thanks,
> > Andrew
> >
> >
>
More information about the Manticore
mailing list