Elm Exactly

Figuredynamic-basis-pow

Figure 51, APPLY\APPLY on Floats: Power, in Section D.4.3 Powers and Elementary Functions.

APPLY(pow,x,y) = {1}if y is a zero = {1}if x is 1 = {NaN}if x or y is NaN = {sgn(x)⋅∞}if x is a zero and y<0 an odd integer = {+∞}if x is a zero and y<0 = {x}if x is a zero and y>0 an odd integer = {+0}if x is a zero and y>0 = {1}if x=−1 and y∈{+∞,−∞} = {+0}if ∣x∣<1 and y=+∞ = {+0}if ∣x∣>1 and y=−∞ = {+∞}if ∣x∣>1 and y=+∞ = {+∞}if ∣x∣<1 and y=−∞ = {+0}if x=+∞ and y<0 = {+∞}if x=+∞ and y>0 = {−0}if x=−∞ and y<0 an odd integer = {−∞}if x=−∞ and y>0 an odd integer = {+0}if x=−∞ and y<0 = {+∞}if x=−∞ and y>0 = {NaN}if x<0 and y is not an integer = {fl(xy)}otherwise \begin{array}{rcll} \APPLY(\kw{pow},x,y) {\ }& = {\ }& \{1\} {\quad}& \text{if}\ y\ \text{is a zero}\\ {\ }& = {\ }& \{1\} {\quad}& \text{if}\ x\ \text{is}\ 1\\ {\ }& = {\ }& \{\dbNaN\} {\quad}& \text{if}\ x\ \text{or}\ y\ \text{is}\ \dbNaN\\ {\ }& = {\ }& \{\dbsgn(x)\cdot\infty\} {\quad}& \text{if}\ x\ \text{is a zero and}\ y<0\ \text{an odd integer}\\ {\ }& = {\ }& \{+\infty\} {\quad}& \text{if}\ x\ \text{is a zero and}\ y<0\\ {\ }& = {\ }& \{x\} {\quad}& \text{if}\ x\ \text{is a zero and}\ y>0\ \text{an odd integer}\\ {\ }& = {\ }& \{+0\} {\quad}& \text{if}\ x\ \text{is a zero and}\ y>0\\ {\ }& = {\ }& \{1\} {\quad}& \text{if}\ x=-1\ \text{and}\ y\in\{+\infty,-\infty\}\\ {\ }& = {\ }& \{+0\} {\quad}& \text{if}\ |x|<1\ \text{and}\ y=+\infty\\ {\ }& = {\ }& \{+0\} {\quad}& \text{if}\ |x|>1\ \text{and}\ y=-\infty\\ {\ }& = {\ }& \{+\infty\} {\quad}& \text{if}\ |x|>1\ \text{and}\ y=+\infty\\ {\ }& = {\ }& \{+\infty\} {\quad}& \text{if}\ |x|<1\ \text{and}\ y=-\infty\\ {\ }& = {\ }& \{+0\} {\quad}& \text{if}\ x=+\infty\ \text{and}\ y<0\\ {\ }& = {\ }& \{+\infty\} {\quad}& \text{if}\ x=+\infty\ \text{and}\ y>0\\ {\ }& = {\ }& \{-0\} {\quad}& \text{if}\ x=-\infty\ \text{and}\ y<0\ \text{an odd integer}\\ {\ }& = {\ }& \{-\infty\} {\quad}& \text{if}\ x=-\infty\ \text{and}\ y>0\ \text{an odd integer}\\ {\ }& = {\ }& \{+0\} {\quad}& \text{if}\ x=-\infty\ \text{and}\ y<0\\ {\ }& = {\ }& \{+\infty\} {\quad}& \text{if}\ x=-\infty\ \text{and}\ y>0\\ {\ }& = {\ }& \{\dbNaN\} {\quad}& \text{if}\ x<0\ \text{and}\ y\ \text{is not an integer}\\ {\ }& = {\ }& \{\dbfl(x^{y})\} {\quad}& \text{otherwise} \end{array}
Figure 51: APPLY\APPLY on Floats: Power
Read it in its chapter·Permanent address: /standard/figures/dynamic-basis-pow

Referred to from

Tests (0)

No test of the suite checks this figure yet.

Discussions

Discuss this figure·Search the discussions on GitHub

Discussions are on GitHub; one about this figure has [fig:dynamic-basis-pow] in its title.

A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.