11 - 382 11 - 382
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
SQR
Function
SQuare Root
• Returns the square root of the specified value.
SQR(<numeric expression>)
Syntax
numeric expression
• • • •
Specify the value for which the square root should be
obtained.
Examples
A=SQR(50)
• • • •
Assigns 50 (= 7.071067...) to A.
Description
• The SQR function returns the square root of the specified value.
• The value of <numeric expression> must be 0 or positive.
• The calculation of the SQR function is performed in single-precision.
Program Example
10 ' This program returns square root values
20 DIM A(10)
:
' Defines an array
30 PRINT "A(I)=","SQR(A(I))="
40 FOR I=1 TO 10
:
' Obtains the square root and displays it
50 A(I)=SQR(I)
60 PRINT I,
70 PRINT A(I)
80 NEXT I
RUN
A(I)= SQR(A(I))=
1 1
2 1.41421
3 1.73205
4 2
5 2.23607
6 2.44949
7 2.64575
8 2.82843
9 3
10 3.16228
OK
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...