| INT |
[Features] Value of a decimal be
discarded is returned.
[Format] INT(n)
[Explanation]
The
result of a minus value differs from fix.
[e.g.]
print
int(-5.4)
-6
| FIX |
[Features] Integer part of n is
returned.
[Format] FIX(n)
[e.g.]
print fix(-5.4)
-5
| ABS |
[Features] Absolute value is
returned.
[Format] ABS(n)
[e.g.]
print abs(-5.4)
5.4
| SGN |
[Features] The sign is
returned.
[Format] SGN(n)
[e.g.]
print sgn(-5.4); sgn(0); sgn(5.4)
-1 0 1
| SQR |
[Features] The square root is
returned.
[Format] SQR(n)
[e.g.]
print sqr(256)
16
| SIN |
[Features] The trigonometric
sine is returned.
[Format] SIN(n)
[Explanation]
n :
radians.
[e.g.] [smp_sin.bas]
100 cls 3
110 line(0,120)-(360,120),col(15)
120 for
i=0 to 360
130 r=rad(i)*2
140 pset(i,cos(r)*64+120),col(10)
150 pset(i,sin(r)*64+120),col(9)
160 pset(i,tan(r)*16+120),col(12)
170 next
180 line(0,0)-(360,32),0,bf
190
line(0,208)-(360,240),0,bf
| COS |
[Features] The trigonometric
cosine is returned.
[Format] COS(n)
[Explanation]
n :
radians.
[e.g.]
c.f. sin [smp_sin.bas]
| TAN |
[Features] The trigonometric
tangent is returned.
[Format] TAN(n)
[Explanation]
n :
radians.
[e.g.]
c.f. sin [smp_sin.bas]
| ATN |
[Features] The arc-tangent is
returned.
[Format] ATN(n)
[Explanation]
To return the angle(radian) that tangent
is 'n'.
[e.g.]
print atn(0.25534192122103627)
0.25
| ATAN2 |
[Features] The arc-tangent is
returned.
[Format] ATAN2(y,x)
[Explanation]
Returns the angle in radians (-π to π) between the half-line from the origin (0,0) to the point (x,y) and the positive x-axis (to the right).
The difference from 'ATN' is that it can check all quadrants of 360 degrees, and even if the parameter is 0,
it will always return an angle (such as 0 degrees) without returning an error.
*By convention for this function, it is written in the order (y,x).
The unit of the returned value is radians.
(The 'init' command can be used to change the angle to 360 units)
[e.g.]
print atan2(3,4)
0.6435011087932844
| ASIN |
[Features] The arc-sine is
returned.
[Format] ASIN(n)
[e.g.]
print asin(0.479425538604203)
0.5
| ACOS |
[Features] The arc-cosine is
returned.
[Format] ACOS(n)
[e.g.]
print acos(0.7316888688738209)
0.75
| LOG |
[Features] The natural logarithm
is returned.
[Format] LOG(n)
| EXP |
[Features] Exponential for the
base of natural logarithm is returned.
[Format] EXP(n)
| FAC |
[Features] The factorial of n is
returned.
[Format] FAC(n)
[Explanation]
The product of all the integers from 1 to
n.
[e.g.]
print fac(5)
120
| PI |
[Features] Pi (π) is
returned.
[Format] PI(n)
[Explanation]
Magnification is specified in n.
When n is omitted, n=1 and return
3.141592653589793.
[e.g.]
print pi()
3.141592653589793
| VAL |
[Features] The numerical value
of string is returned.
[Format] VAL("string")
[Explanation]
Attach
"&h", it can convert decimal number from hexadecimal.
Attach "&b", it can convert decimal number
from Binary-number.
16bit left edge of Binary-number, it is minus flag. (1=flag on)
[-32762~-1] and [32762~65535] are the
same value in Binary-number.
By
'val("&b")', it always return a positive value,
when reckon the leftmost 16bit
as minus flag, a minus value is acquired as follows.
d=val("&b1111101100101110")
if d>32767 then d=d-65536
print d
-1234
[e.g.]
a=val("123")
b=val("&hc8")
print a;b
123 200
| BIN$ |
[Features] A decimal number is
made into the character string of a binary number, and is returned.
[Format] BIN$(n)
[Explanation]
'n' is truncated a decimal, and it
is converted as 32bit Binary number.
The range of 'n' is
-2147483648 to 4294967296.
[-2147483648~-1] and
[2147483648~4294967296] are the same value in
Binary-number.
When bit left side is a sequence of '0',
the notation of the digit that omit it is returned.
For
always keeping to make all of 16bit length at small number, to performe as
follows.
n=1234
b$=right$(string$(15,"0")+bin$(n),16)
print b$
0000010011010010
[e.g.]
print bin$(12345)
11000000111001
| HEX$ |
[Features] A decimal number is
made into the character string of a Hexadecimal number, and is returned.
[Format] HEX$(n)
[Explanation]
'n' is truncated a
decimal, and it is converted as 32bit Hexadecimal number.
The range of 'n' is -2147483648 to 4294967296.
[-2147483648~-1] and [2147483648~4294967296] are the same value in Hexadecimal
number.
When bit left side is a sequence of '0', the
notation of the digit that omit it is returned.
[e.g.]
print hex$(61640)
F0C8
| RND |
[Features] Random number between
0 and 1(less than) is returned.(Decimal)
[Format] RND(n)
[Explanation]
n=Positive number: to generate random number.
n=0: to get the value of the random
number generated last time.
n=Negative
number: to set random generator series to initial and generate.
[e.g.]
print rnd(1)
0.2189351810794058
print rnd(1)
0.7110011485445428
print rnd(0)
0.7110011485445428
print int(rnd(1)*8)
5
print int(rnd(1)*8)
2
| IRND |
[Features] Random number between
0 and n(less than) is returned.(Integer)
[Format] IRND(n)
[Explanation]
Integral random number can be generated more easily than 'RND'.
[e.g.]
print rnd(8)
3
print rnd(8)
6
| RANDOMIZE (command) |
[Features] To specify random
generator series by integer 'n'.
[Format] RANDOMIZE n
[Explanation]
When specify same number, the same random series is generated every time.
It is set to both 'RND' and 'IRND'.
[e.g.]
randomize 24
print rnd(1): print rnd(1)
0.5794032907737137
0.09072188541414071
randomize 24
print rnd(1): print rnd(1)
0.5794032907737137
0.09072188541414071
| RAD |
[Features] To changed 'degree'
into 'radian'.
[Format] RAD(n)
[e.g.]
print
rad(180)
3.141592653589793
| DEG |
[Features] To changed 'radian'
into 'degree'.
[Format] DEG(n)
[e.g.]
print
deg(6.28)
359.81749534215703
| MAX |
[Features] To return the larger
number between two numbers.
[Format] MAX(n,m)
[e.g.]
print
max(12,24)
24
| MIN |
[Features] To return the smaller
number between two numbers.
[Format] MIN(n,m)
[e.g.]
print
min(12,24)
12
| RANGE |
[Features] Numerical value is
maked within the specified range.
[Format] RANGE(n,min,max)
[e.g.]
print
range(6,12,24)
12
| CALC |
[Features] "Formula string" is
calculated as a formula and the value is returned.
[Format] CALC("Formula string")
[Explanation]
A
variable, arrangement, and built-in functions can be used.
In the case of string then string,
numeric value then numeric value, it return.
[e.g.]
b=calc("(a+2)*10")
print b
It can give "Formula string" with a string
variable in interpreter mode.
In
compiler mode, it is possible only when return value is a numerical value.
(In this case, the operating speed of the
calculation is equal to the interpreter mode)
c$="(a+2)*10"
b=calc(c$)
print b
| BCD$ |
[Features] To perform decimal
digits calculation with no decimal error.(long digits OK.)
[Format] BCD$("Calculation-type","Number1","Number2")
[Explanation]
Since it treat a long digit, numeric data
is given by string.
The result is also
returned as string.
It can calculate
an accidental error does not occurs.
"Calculation-type" is selected from the
following.
"add" Addition
"sub" Subtraction
"mult" Multiplication
"div" Division
"scale"
This is parameter setting, not a calculation.
The digit number below a decimal
point in the result is specified.
Protrude digit is rounded off.
It is specified by "Number1".
("Number2" does not describe)
It is adapted for the result of Division.
[e.g.]
'Addition
print
bcd$("add","1234567890.12345","1212.1212")
1234569102.24465
'Division -
Below decimal point 12digit
r$=bcd$("scale","12")
r$=bcd$("div","10","3")
print r$
3.333333333333