Microsoft KB Archive/65942

= BUG: Zero to Zero Power Returns Bad Result If Compiled w/68881 =

Article ID: 65942

Article Last Modified on 10/20/2003

-

APPLIES TO


 * Microsoft QuickBasic Compiler for Macintosh 1.0
 * Microsoft QuickBasic Compiler for Macintosh 1.0

-



This article was previously published under Q65942



SYMPTOMS
If a program is compiled with the &quot;Generate 68881 Code&quot; option under QuickBasic (b) (binary math version) and it attempts to raise 0 (zero) to the power of 0 (zero), the program will return 0 (zero) instead of the correct answer, which is 1.

Microsoft has confirmed this to be a bug with Microsoft QuickBasic versions 1.00 and 1.00a for Macintosh systems. We are researching this problem and will post new information here as it becomes available.



MORE INFORMATION
If the sample program below is compiled with the &quot;Generate 68881 Code&quot; option (from the Options command in the Run menu of QuickBasic binary math version), the program will return an erroneous result (0). If the program is run inside the QuickBasic interpreter environment, the program runs properly and the correct result is 1.

The program fails only under the two conditions shown below, where X=0 and Y=0:   Y ^ X    or    0 ^ X Note that the expression 0^0 works correctly.

Sample Code
X= 0 Y= 0 PRINT &quot;Y^X &quot;,Y ^ X  'Zero raised to the power of zero gives problem. PRINT &quot;0^X &quot;,0 ^ X  'This form also produces the problem. PRINT &quot;0^0 &quot;,0 ^ 0  'This works. WHILE INKEY$ = &quot;&quot; : WEND END

Additional query words: MQuickB

Keywords: kbbug KB65942

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.