[AccessD] Weekend fun: Primes

stuart at lexacorp.com.pg stuart at lexacorp.com.pg
Fri Dec 9 18:54:14 CST 2005


On 9 Dec 2005 at 18:17, Josh McFarlane wrote:

> On 12/9/05, stuart at lexacorp.com.pg <stuart at lexacorp.com.pg> wrote: >
> You can use "scaled integers": > > Currency > - 8 bytes =
> -922,337,203,685,477.5808 to 922,337,203,685,477.5807 > or > Decimal >
> - 14 bytes =  +/-79,228,162,514,264,337,593,543,950,335 with no
> decimal point
> 
> But then you enter the land of floating point calculations. 

They are not floats, they are scaled integers.  They are stored and manipulated in  
integer format. 

Decimals are stored as 96-bit (12-byte) signed integers scaled by a variable power of 
10. The power of 10 scaling factor specifies the number of digits to the right of 
the decimal point, and ranges from 0 to 28

Currency variables are stored as 64-bit (8-byte) numbers in an integer format, 
scaled by 10,000 to give a fixed-point number with 15 digits to the left of the 
decimal point and 4 digits to the right

> It was more out of curiosity though, as C++ has long long.

So does PowerBASIC - "Quad-integers are 64-bit (8 byte) signed integers (twice as 
many bits as Long integers) with a range of -9.22x10^18 to 9.22x10^18  ( -2^63 to 
2^63 -1)."


   




More information about the AccessD mailing list