| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | power(y,x) for VP, test |
A crude text mode test for the power(y,x) function for Virtual Pascal
which I posted in another message. TIA for any comments, complaints,
etc from those who try the power function.
Patrick
___---------------------------------------------------------------------------
program testmath;
uses use32, crt, math;
var
x, y, answer : extended;
ch : char;
const
MaxFloat : extended = 1.1E4932;
begin { main }
repeat
WriteLn('testing the power function y to the x');
Write('input the number y = '); ReadLn(y); { no validation! }
Write('input the power x = ');ReadLn(x); { no validation! }
answer := power(y, x);
if answer > MaxFloat then writeln('OverFlow...');
WriteLn('answer is ', answer);
WriteLn;
Write('Press ESC to exit, any other key to continue...');
ch := ReadKey;
ClrScr;
until ch = #27;
end.
___
X KWQ/2 1.2i X I'm not young enough to know everything anymore...
--- Maximus/2 2.02
* Origin: OS/2 Online * Auburn, WA * 206-351-5998 * (1:343/212)SEEN-BY: 270/101 620/243 711/401 409 410 413 430 808 809 934 955 712/407 515 SEEN-BY: 712/517 628 713/888 800/1 7877/2809 @PATH: 343/212 800 1 138/103 3615/50 396/1 270/101 712/515 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.