Re: Fastcode RoundTo B&V 0.1
From: John Herbster (herb-sci1_AT_sbcglobal.net)
Date: 06/13/04
- Next message: Avatar Zondertau: "Re: Valid Object"
- Previous message: Soeren Muehlbauer: "Valid Object"
- In reply to: Solerman Kaplon: "Re: Fastcode RoundTo B&V 0.1"
- Next in thread: Solerman Kaplon: "Re: Fastcode RoundTo B&V 0.1"
- Reply: Solerman Kaplon: "Re: Fastcode RoundTo B&V 0.1"
- Reply: Dennis: "Re: Fastcode RoundTo B&V 0.1"
- Reply: Dennis: "Re: Fastcode RoundTo B&V 0.1"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 13 Jun 2004 09:24:36 -0500
"Solerman Kaplon" <solerman@wonder.com.br> wrote
> Is there an advantage in caching the multiplier/divisor
> (100 in 2, 1000 in 3)?
Solerman,
You could cache an array [0..27] of extended (Int64 only
has enough bits for 10^19) or just build it in to the code.
Const Multipliers: array [0..27] of extended = (
1e00,1e01,1e02,1e03,1e04,1e05,1e06,1e07,1e08,1e09,
1e10,1e11,1e12,1e13,1e14,1e15,1e16,1e17,1e18,1e19,
1e20,1e21,1e22,1e23,1e24,1e25,1e26,1e27);
These are calculated correctly by D7.1 compiler.
Beyond 27, an extended type cannot hold the precision and
the roundings would not be precise. I am tempted to raise
an exception for abs(Digits) > 27.
Regards, JohnH
- Next message: Avatar Zondertau: "Re: Valid Object"
- Previous message: Soeren Muehlbauer: "Valid Object"
- In reply to: Solerman Kaplon: "Re: Fastcode RoundTo B&V 0.1"
- Next in thread: Solerman Kaplon: "Re: Fastcode RoundTo B&V 0.1"
- Reply: Solerman Kaplon: "Re: Fastcode RoundTo B&V 0.1"
- Reply: Dennis: "Re: Fastcode RoundTo B&V 0.1"
- Reply: Dennis: "Re: Fastcode RoundTo B&V 0.1"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|