Exponential: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
(Created page with ":''This page describes the monadic arithmetic function. For the dyadic function, see Power (function).'' {{Built-in|Exponential|*}} is a monadic scalar function w...")
 
m (Text replacement - "<source" to "<syntaxhighlight")
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
:''This page describes the monadic arithmetic function. For the dyadic function, see [[Power (function)]].''
:''This page describes the monadic arithmetic function. For the dyadic function, see [[Power (function)]].''


{{Built-in|Exponential|*}} is a [[monadic]] [[scalar function]] which computes the [[wikipedia:exponential function|exponential function]] (i.e. the power of [[wikipedia:e (mathematical constant)|Euler's constant e]]) of the [[argument]]. Exponential shares the [[glyph]] <source lang=apl inline>*</source> with the dyadic arithmetic function [[Power]].
{{Built-in|Exponential|*}} is a [[monadic]] [[scalar function]] which computes the [[wikipedia:exponential function|exponential function]] (i.e. the power of [[wikipedia:e (mathematical constant)|Euler's constant e]]) of the [[argument]]. Exponential shares the [[glyph]] <syntaxhighlight lang=apl inline>*</syntaxhighlight> with the dyadic arithmetic function [[Power]].


== Examples ==
== Examples ==
Line 7: Line 7:
Euler's constant itself can be obtained by supplying 1 as the argument.
Euler's constant itself can be obtained by supplying 1 as the argument.


<source lang=apl>
<syntaxhighlight lang=apl>
       *1
       *1
2.718281828
2.718281828
</source>
</syntaxhighlight>


On APL implementations that support [[complex]] numbers, one can demonstrate [[wikipedia:Euler's identity|Euler's identity]] (with the help of [[Pi Times]] <source lang=apl inline>○</source>):
On APL implementations that support [[complex]] numbers, one can demonstrate [[wikipedia:Euler's identity|Euler's identity]] (with the help of [[Pi Times]] <syntaxhighlight lang=apl inline>○</syntaxhighlight>):


<source lang=apl>
<syntaxhighlight lang=apl>
       1+*○0J1
       1+*○0J1
0
0
</source>{{Works in|[[Dyalog APL]]}}
</syntaxhighlight>{{Works in|[[Dyalog APL]]}}


== Properties ==
== Properties ==


Exponential is a special case of [[Power]] with the default left argument of e (<source lang=apl inline>*1</source>).
Exponential is a special case of [[Power]] with the default left argument of e (<syntaxhighlight lang=apl inline>*1</syntaxhighlight>).


<source lang=apl>
<syntaxhighlight lang=apl>
       ((*1)∘* ≡ *) *0 1 ¯1 0J1
       ((*1)∘* ≡ *) 0 1 ¯1 0J1
1
1
</source>{{Works in|[[Dyalog APL]]}}
</syntaxhighlight>{{Works in|[[Dyalog APL]]}}


Exponential and [[Natural Logarithm|natural log]] <source lang=apl inline>⍟</source> are inverses of each other, except where the natural log is undefined.
Exponential and [[Natural Logarithm|natural log]] <syntaxhighlight lang=apl inline>⍟</syntaxhighlight> are inverses of each other, except where the natural log is undefined.


<source lang=apl>
<syntaxhighlight lang=apl>
       (⊢ ≡ ⍟∘*) 0 1 ¯1 0J1
       (⊢ ≡ ⍟∘*) 0 1 ¯1 0J1
1
1
       (⊢ ≡ *∘⍟) 1 ¯1 0J1 ⍝ natural log of zero is undefined
       (⊢ ≡ *∘⍟) 1 ¯1 0J1 ⍝ natural log of zero is undefined
1
1
</source>{{Works in|[[Dyalog APL]]}}
</syntaxhighlight>{{Works in|[[Dyalog APL]]}}


== See also ==
* [[Circular]]
== External links ==
== External links ==


=== Documentation ===
=== Documentation ===


* [http://help.dyalog.com/latest/#Language/Primitive%20Functions/Exponential.htm Dyalog]
* [https://help.dyalog.com/latest/#Language/Primitive%20Functions/Exponential.htm Dyalog]
* [http://microapl.com/apl_help/ch_020_020_190.htm APLX]
* [http://microapl.com/apl_help/ch_020_020_190.htm APLX]
* J [https://www.jsoftware.com/help/dictionary/d200.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/hat NuVoc]
* J [https://www.jsoftware.com/help/dictionary/d200.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/hat NuVoc]
* [https://mlochbaum.github.io/BQN/doc/arithmetic.html#basic-arithmetic BQN]
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]]
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]]

Latest revision as of 22:25, 10 September 2022

This page describes the monadic arithmetic function. For the dyadic function, see Power (function).
*

Exponential (*) is a monadic scalar function which computes the exponential function (i.e. the power of Euler's constant e) of the argument. Exponential shares the glyph * with the dyadic arithmetic function Power.

Examples

Euler's constant itself can be obtained by supplying 1 as the argument.

      *1
2.718281828

On APL implementations that support complex numbers, one can demonstrate Euler's identity (with the help of Pi Times ):

      1+*○0J1
0
Works in: Dyalog APL

Properties

Exponential is a special case of Power with the default left argument of e (*1).

      ((*1)∘* ≡ *) 0 1 ¯1 0J1
1
Works in: Dyalog APL

Exponential and natural log are inverses of each other, except where the natural log is undefined.

      (⊢ ≡ ⍟∘*) 0 1 ¯1 0J1
1
      (⊢ ≡ *∘⍟) 1 ¯1 0J1 ⍝ natural log of zero is undefined
1
Works in: Dyalog APL

See also

External links

Documentation

APL built-ins [edit]
Primitives (Timeline) Functions
Scalar
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare Root
Dyadic AddSubtractTimesDivideResiduePowerLogarithmMinimumMaximumBinomialComparison functionsBoolean functions (And, Or, Nand, Nor) ∙ GCDLCMCircularComplexRoot
Non-Scalar
Structural ShapeReshapeTallyDepthRavelEnlistTableCatenateReverseRotateTransposeRazeMixSplitEncloseNestCut (K)PairLinkPartitioned EnclosePartition
Selection FirstPickTakeDropUniqueIdentityStopSelectReplicateExpandSet functions (IntersectionUnionWithout) ∙ Bracket indexingIndexCartesian ProductSort
Selector Index generatorGradeIndex OfInterval IndexIndicesDealPrefix and suffix vectors
Computational MatchNot MatchMembershipFindNub SieveEncodeDecodeMatrix InverseMatrix DivideFormatExecuteMaterialiseRange
Operators Monadic EachCommuteConstantReplicateExpandReduceWindowed ReduceScanOuter ProductKeyI-BeamSpawnFunction axis
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Withe, Atop, Over) ∙ Inner ProductDeterminantPowerAtUnderRankDepthVariantStencilCutDirect definition (operator)
Quad names Index originComparison toleranceMigration levelAtomic vector