Re: FastCode RoundToEx
- From: "John Herbster" <herb-sci1_AT_sbcglobal.net>
- Date: Sat, 29 Dec 2007 11:11:33 -0600
"Dennis" <marianndkc@xxxxxxxxxxxxxxx> wrote
Claim 5: "After all, 10^27 does have an exact representation in the extended variable type."
Sure it has
10^27 = 1E27
So has
10^4932= 1E4932
Denis, I see that you have already retracted the referenced claim message.
But the readers may be interested in looking at the following code and results.
procedure TForm1.Button2Click(Sender: TObject);
{ Test of max power of ten representable in a type extended variable. }
{sub}procedure DoTest(N,MinE,MaxE: integer);
var e: integer; Value: extended; s: string;
begin
For e := MinE to MaxE do begin
Value := IntPower(N,e);
s := ExactFloatToStrEx(Value);
LogFmt('%D^%D = %S',[N,e,s]);
end;
end;
const MinN = 26; MaxN = 28;
begin
DoTest(10,MinN,MaxN);
DoTest( 2,MinN,MaxN);
DoTest( 5,MinN,MaxN);
end;
10^26 = + 10 00000 00000 00000 00000 00000
10^27 = + 100 00000 00000 00000 00000 00000
10^28 = + 999 99999 99999 99999 97315 64544
2^26 = + 671 08864
2^27 = + 1342 17728
2^28 = + 2684 35456
5^26 = + 1490 11611 93847 65625
5^27 = + 7450 58059 69238 28125
5^28 = + 37252 90298 46191 40624
Note that the last digit of powers of 5 should be 5.
--JohnH
.
- References:
- FastCode RoundToEx
- From: Dennis
- Re: FastCode RoundToEx
- From: Dennis
- FastCode RoundToEx
- Prev by Date: Re: FastCode RoundToEx
- Next by Date: Re: FastCode Poll - Which Functions are Used
- Previous by thread: Re: FastCode RoundToEx
- Next by thread: Re: FastCode RoundToEx
- Index(es):