"Illegal Function Call," Negative Number to Fractional Power (67887)
The information in this article applies to:
- Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0
- Microsoft BASIC Compiler, when used with:
- the operating system: Mac OS (all versions)
- Microsoft BASIC Interpreter for Apple Macintosh 1.0
- Microsoft BASIC Interpreter for Apple Macintosh 1.01
- Microsoft BASIC Interpreter for Apple Macintosh 2.0
- Microsoft BASIC Interpreter for Apple Macintosh 2.1
- Microsoft BASIC Interpreter for Apple Macintosh 3.0
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft QuickBASIC for MS-DOS 5.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1
- Microsoft GW-Basic Interpreter 3.20
- Microsoft GW-Basic Interpreter 3.22
- Microsoft GW-Basic Interpreter 3.23
This article was previously published under Q67887 SUMMARY
Raising a negative number to a fractional power gives an "Illegal
function call" in Basic because the result will be a complex number,
which is not supported in Basic. (A complex number is of the form
x+y*i where x is the real component and y is the imaginary component;
i is the square root of -1.)
Note: -5^(-Y) is not the same as X^(-Y) when X = -5 because -5^(-Y) is
actually parsed as -(5^(-Y)). In other words, the exponentiation
operator (^) has greater precedence than the subtraction (-) operator.
This information applies to most versions of Microsoft Basic,
including the following:
- Microsoft QuickBasic version 1.00 for the Apple Macintosh.
- Microsoft Basic Compiler version 1.00 for the Apple Macintosh.
- Microsoft Basic Interpreter versions 1.00, 1.01, 2.00, 2.10, and
3.00 for the Apple Macintosh.
- Microsoft QuickBasic versions 1.00, 1.01, 1.02, 2.00, 2.01, 3.00,
4.00, 4.00b, 4.50 for MS-DOS.
- Microsoft Basic Compiler versions 5.35 and 5.36 for MS-DOS.
- Microsoft Basic Compiler versions 6.00 and 6.00b for MS OS/2 and
MS-DOS.
- Microsoft Basic Professional Development System (PDS) versions 7.00
and 7.10 for MS-DOS and MS OS/2.
- Microsoft GW-Basic Interpreter versions 3.20, 3.22, 3.23 for
MS-DOS.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB67887 |
---|
|