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?

$ZLOG

指定された正の数の式の、常用対数の値を返します。

Synopsis

$ZLOG(n)

パラメータ

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

概要

$ZLOG は、n の常用対数値を返します。

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

対応する自然対数 (基数 e) 関数は、$ZLN です。

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

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

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

The log of 1 = 0
The log of 2 = .301029995663981195
The log of 3 = .477121254719662437
The log of 4 = .60205999132796239
The log of 5 = .698970004336018805
The log of 6 = .778151250383643633
The log of 7 = .845098040014256831
The log of 8 = .903089986991943586
The log of 9 = .954242509439324875
The log of 10 = 1
   WRITE $ZLOG($ZPI)

これは、.4971498726941338541 を返します。

   WRITE $ZLOG(.5)

これは、-.301029995663981195 を返します。

   WRITE $ZLOG(0)

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

関連項目

FeedbackOpens in a new tab