EGL 라이브러리 mathLib
EGL mathLib 함수는 공통 수학 함수와 삼각 함수를 수행합니다.
대부분 mathLib 함수의 입력과 출력 유형은 FLOAT여서 다양한 지정 호환 가능 값에 대해 함수가 작용할 수 있습니다. 10진수 값과 부동 소수점 간 변환에서 일부 정밀도가 손실될 수 있습니다.
mathLib 함수는 모든 대상 시스템에서, COBOL과 Java™용으로 생성된 코드에서 작동합니다. Java의 경우 EGL은 EGL 함수와 동등한 Java StrictMath 클래스의 메소드를 사용합니다. 그러면 모든 JVM(Java Virtual Machine)에서 런타임 동작이 동일합니다.
함수
다음 표에 시스템 라이브러리 mathLib의 함수가 나열되어 있습니다.
| 시스템 함수/호출 | 설명 |
|---|---|
| result = abs (numericVariable) | numericVariable의 절대값을 리턴합니다. |
| result = acos (numericVariable) | numericVariable의 아크 코사인을 리턴합니다. |
| result = asin (numericVariable) | numericVariable의 아크 사인을 리턴합니다. |
| assign (source, target) | source의 값을 target에 지정할 때 V6 반올림을 유지합니다. |
| result = atan (numericVariable) | numericVariable의 아크 탄젠트를 리턴합니다. |
| result = atan2 (numericVariable1, numericVariable2) | 리턴값의 사분면을 판별하기 위해 두 인수의 부호를 사용하여 numericVariable1/numericVariable2의 아크 탄젠트 프린시펄 값을 계산합니다. |
| result = ceiling (numericVariable) | numericVariable 이상의 가장 작은 정수를 리턴합니다. |
| result = cos (numericVariable) | numericVariable의 코사인을 리턴합니다. |
| result = cosh (numericVariable) | numericVariable의 쌍곡 코사인을 리턴합니다. |
| result = decimals (numericVariable) | numericVariable에 정의된 소수 자리의 수를 리턴합니다. |
| result = exp (numericVariable) | numericVariable의 지수 값을 리턴합니다. |
| result = floor (numericVariable) | numericVariable 이하의 가장 큰 정수를 리턴합니다. |
| result = frexp (numericVariable, integer) | 숫자를 .5 - 1 범위의 정규화 소수(리턴된 값)와 제곱(integer로 리턴됨)으로 분할합니다. |
| result = ldexp (numericVariable, integer) | 2의 integer제곱을 곱한 numericVariable을 리턴합니다. |
| result = log (numericVariable) | numericVariable의 자연 로그를 리턴합니다. |
| result = log10 (numericVariable) | numericVariable의 밑이 10인 로그를 리턴합니다. |
| result = max (numericVariable1, numericVariable2) | numericVariable1과 numericVariable2 중 큰 값을 리턴합니다. |
| result = min (numericVariable1, numericVariable2) | numericVariable1과 numericVariable2 중 작은 값을 리턴합니다. |
| result = modf (numericVariable1, numericVariable2) |
|
| result = pow (numericVariable1, numericVariable2) | numericVariable1의 numericVariable2제곱을 리턴합니다. |
| result = precision (numericVariable) | numericVariable의 최대 정밀도(10진수 숫자에서)를 리턴합니다. |
| result = round (numericVariable, integer) | 숫자 또는 표현식을 가장 가까운 값(예: 가장 가까운 천 단위)으로 반올림하고 결과를 리턴합니다. |
| result = sin (numericVariable) | numericVariable의 사인을 리턴합니다. |
| result = sinh (numericVariable) | numericVariable의 쌍곡 사인을 리턴합니다. |
| result = sqrt (numericVariable) | numericVariable이 0보다 크거나 같은 경우 numericVariable의 제곱근을 리턴합니다. |
| result = tan (numericVariable) | numericVariable의 탄젠트를 리턴합니다. |
| result = tanh (numericVariable) | numericVariable의 쌍곡 탄젠트를 리턴합니다. |
오류 조건
다음 표에는 mathLib 함수가 오류에 응답하는 방법이 표시되어 있습니다. 두 개의 서로 다른 시나리오가 적용됩니다. 기본 시나리오에서는 EGL이 두 번째 열에 표시되어 있는 예외를 처리합니다. 다른 시나리오는 V6 예외 모드(V6 예외 호환성 사용 참조)에서 발생합니다. 이 경우 EGL은 예외를 처리하지 않으며 sysVar.errorCode가 세 번째 열의 값으로 설정됩니다.
| 오류 | EGL 예외(기본값) | sysVar.errorCode(V6 예외) |
|---|---|---|
| 올바르지 않은 입력 | RuntimeException | 00000008 |
| 대상 변수에 값을 지정할 수 없음 | RuntimeException | 00000012 |
| 기타 | 기타 | 00000016 |