General information
Category:
Coding, syntax & commands
>Ahem, are you certain vfp currency is not up to the job ? IIRC it is an 8-byte signend integer with an "arbitrary" set decimal point resulting in 4 decimals. So if you are certain you will not have any decimals, you can eliminate or "shift" the 4 decimals. And if it is only for hash codes, where probably the only questions asked are == and !=, why not implement in C and just save the result, either as 2 integers or currency or in this case my favorite varchar binary ? Last one can grow above 8 byte length if the collision area needs to be reduced by enlarging hash result abd function....
>
>curious
>
>thomas
Currency is stored in VFP as a 64-bit integer with 4-implied decimals. It holds 18-19 decimals of precision. There's a warning in the VFP Help under System Capacities that it can compute a maximum of 15-16 significant digits of accuracy, as it uses an internal 64-bit floating point value to carry out calculations.
The bignum.vcx class could be extended to create a bigint subset, allowing for arbitrary precision integers. GMP is good for that, and the same code could wrap around it for the integer portion.
See attached for the bignum C/C++ source code (not including the bigint subset).
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only