RosettaCodeData/Task/Real-constants-and-functions/IS-BASIC/real-constants-and-functions.basic
2023-07-01 13:44:08 -04:00

20 lines
1.2 KiB
Text

100 LET X=2:LET Y=5
110 PRINT EXP(1) ! value of e
120 PRINT PI ! value of Pi
130 PRINT ROUND(PI,3) ! rounds Pi to 3 decimal places
140 PRINT TRUNCATE(PI,3) ! cuts 3 decimal places from Pi
150 PRINT SQR(X) ! square root of x
160 PRINT LOG(X) ! the natural logarithm of number x
170 PRINT LOG2(X) ! logarithm of x to base 2
180 PRINT LOG10(X) ! logarithm of x to base 10
190 PRINT EXP(X) ! exponential
200 PRINT ABS(X) ! the absolute value of a number
210 PRINT INT(X) ! the largest whole number not bigger than x
220 PRINT IP(X) ! the integer part of x
230 PRINT FP(X) ! stands for fractorial part
240 PRINT CEIL(X) ! ceiling: gives the smallest whole number not less than x
250 PRINT X^Y ! power
260 PRINT MIN(X,Y) ! the smaller number of x and y
270 PRINT MAX(X,Y) ! the bigger number of x and y
280 PRINT EPS(X) ! the smallest quantity that can be added to or subtracted from x to make the interpreter register a change in the value of x
290 PRINT INF ! The largest positive number the tinterpreter can handle. This number is 9.999999999*10^62