Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

$ZLN

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

Synopsis

$ZLN(n)

パラメータ

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

概要

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

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

対応する自然対数べき関数は、$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