如何於 RPG 中使用三角函數?
利用 QC2LE 函數館 呼叫 C 三角函數
File : QRPGLESRC
Member: TRIGONOR
Type : RPGLE
Usage : CRTBNDRPG TRIGONOR
CALL TRIGONOR
* =========================================================
* = Using C function library trigonometric functions =
* =========================================================
H BndDir( 'QC2LE' )
H DftActGrp( *No )
D GetCosine Pr 8F ExtProc( 'cos' )
D 8F Value
D GetArcCosine Pr 8F ExtProc( 'acos' )
D 8F Value
D Pi S 8F
D Angle S 3 0 Inz( 30 )
D Radians S 8F
D Cosine S 8F
* arc cosine of -1 is Pi
C Eval Pi = GetArcCosine( -1 )
C Eval Radians = ( Angle * Pi ) / 180
C Eval Cosine = GetCosine( Radians )
C Eval *InLR = *On
參考資料
IBM Redbook
"Who Knew You Could Do That with RPG IV?," Chapter 5 學習如何於 RPG 中利用 C 函數
http://publib-b.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569ae006bb65f/a555adfe471ddb288625677c006176c0?OpenDocument
A blog about IBM i (AS/400), MQ and other things developers or Admins need to know.
星期三, 11月 01, 2023
2002-02-22 如何於 RPG 中使用三角函數?
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言