Numerical Values in Full BASIC

Numerical Operation

The Full BASIC standard provides the accuracy of numerical operations including supplied functions. Notice that some operation results may violate the common sense in mathematics, while they can be considered to have satisfactory accuracy in ordinary use.

The accuracy is guaranteed in an operation. The result of continual operations happens to differ from the right answer in mathematics.
For example, the result of the following program is "N".

10 LET a=120
20 IF SQR(a)^2 = a THEN PRINT "Y" ELSE PRINT "N"
30 END

That is, the square of the square root differed from the source. This was caused by the fact that SQR(120) can be represented only in an approximate value.
Try to change the value in line 10 to a square number as 144, to obtain the result "Y", because Full BASIC correctly calculates the square root of a square number.


Back