Skip to main content

This documentation is for an older version of this product. See the latest version of this content.Opens in a new tab

$ZLN (ObjectScript)

指定された数の自然対数を返します。

Synopsis

$ZLN(n)

引数

引数 説明
n ゼロ以外の正の数字。値、変数、式として指定できます。

説明

$ZLN は、n の自然対数 (基数 e) を返します。

ゼロや負数を指定すると <ILLEGAL VALUE> エラーが発生します。

非数値文字列は 0 として評価されるため、<ILLEGAL VALUE> エラーが発生します。混合数値文字列および非数値文字列の評価の詳細は、"ObjectScript の使用法" の "数値としての文字列" を参照してください。

対応する自然対数べき関数は、$ZEXP です。

以下の例は、1 から 10 の整数の自然対数を記述します。

   FOR x=1:1:10 {
     WRITE !,"The natural log of ",x," = ",$ZLN(x) 
     }
   QUIT

これは、以下を返します。

The natural log of 1 = 0
The natural log of 2 = .6931471805599453089
The natural log of 3 = 1.098612288668109691
The natural log of 4 = 1.386294361119890618
The natural log of 5 = 1.609437912434100375
The natural log of 6 = 1.791759469228055002
The natural log of 7 = 1.945910149055313306
The natural log of 8 = 2.079441541679835929
The natural log of 9 = 2.197224577336219384
The natural log of 10 = 2.302585092994045684

以下の例は、$ZLN と $ZEXP の関係を示しています。

   SET x=$ZEXP(1) ; x = 2.718281828459045236
   WRITE $ZLN(x)

これは、1 を返します。

   WRITE $ZLN(0)

これは、<ILLEGAL VALUE> エラーを発行します。

関連項目

FeedbackOpens in a new tab