TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Patrick Annette
date: 1995-12-18 11:39:00
subject: BUG in power for VP

Yesterday I posted a function written using Virtual Pascal's builtin
assembler for computing the power of a number power(y,x); today I found
the first bug!  

I wasn't popping the stack properly when a 0 was passed as the first
argument, so after that happened a few times, the function would return
garbage.

The following is the final few lines of the unit as corrected:

___----------------------------------------------------------


{at}was_z2:
      fscale       { just need to scale by 2**st(1) }
{at}get_out:
      fstp   st(1)
      fstp {at}result
   end;
end;

begin
end.

___----------------------------------------------------------

Sorry about that....

Patrick

___
 X KWQ/2 1.2i X Cut welfare for destitute two year olds.  Love those conservative
--- 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™.