Code: Select all
10 PRINT (7-SQR(50))^(1/3)+(7+SQR(50))^(1/3)
RUN
? ILLEGAL FUNCTION CALL
ERROR IN 10
READY.
Mike, are you reading this ?
(P.S. I was watching this youtube video)
Moderator: Moderators
Code: Select all
10 PRINT (7-SQR(50))^(1/3)+(7+SQR(50))^(1/3)
RUN
? ILLEGAL FUNCTION CALL
ERROR IN 10
READY.
Yes.nippur72 wrote:Mike, are you reading this?
As you know, the exponentiation operator is quite complex. For arbitrary exponents, it is actually only well defined for positive numbers as bases. Only in case of integer exponents, and by convention(!), negative numbers as bases are also allowed - but the expression "(7-SQR(50))^(1/3)" has a base less than zero and a non-integer exponent (1/3). Which is the valid reason MS BASIC throws an error.For an unknown reason, the evaluation of this formula fails:
[...]Code: Select all
10 PRINT (7-SQR(50))^(1/3)+(7+SQR(50))^(1/3) RUN ?ILLEGAL FUNCTION CALL ERROR IN 10 READY.
Code: Select all
1 DEFFNCB(X)=SGN(X)*(ABS(X)^(1/3))
2 PRINTFNCB(7-SQR(50))+FNCB(7+SQR(50))
RUN
ok, but now PRINT 7-SQR(50), it gives you -.071067813, go with the VIC20 cursor and turn that into PRINT -.071067813 ^ (1/3) ... it gives you the result without complaining! So the problem is not in the base < 0 and non integer exponent.
http://sleepingelephant.com/ipw-web/bul ... ilit=binds ...nippur72 wrote:ok, but now PRINT 7-SQR(50), it gives you -.071067813, go with the VIC20 cursor and turn that into PRINT -.071067813 ^ (1/3) ... it gives you the result without complaining! So the problem is not in the base < 0 and non integer exponent. [...]
That does not exclude other countries, if you have any problems with my explanation above.wimoos wrote:Ahem...