Elm Exactly

Basis entryBasics.atan2

A value of Basics. Its type is in Section C.3 Basics.

Static basis

var ↦ (σ,is)atan2 ↦ (Float→Float→Float,v)\begin{array}{|rcl|}\hline \var {\ }& \mapsto {\ }& (\sigma, \is)\\\hline \href{/standard/basis/Basics/atan2}{\kw{atan2}} {\ }& \mapsto {\ }& (\tFloat \rightarrow \tFloat \rightarrow \tFloat, \isv)\\\hline\end{array}
Figure 39: Static VE\VE of ME0(Basics)\ME_0(\kw{Basics}): Floating-point Functions and Function Helpers

Dynamic basis

var or con ↦ varityatan2 ↦ basic value2\begin{array}{|rclc|}\hline \var\ \text{or}\ \con {\ }& \mapsto {\ }& v {\qquad}& \arity\\\hline \href{/standard/basis/Basics/atan2}{\kw{atan2}} {\ }& \mapsto {\ }& \text{basic value} {\qquad}& 2\\\hline\end{array}
Figure 45: Dynamic VE\VE of ME0(Basics)\ME_0(\kw{Basics})

Its APPLY

APPLY(atan2,y,x) = {NaN}if x or y is NaN = {y}if y is a zero, and x is +0 or x>0 = {sgn(y)⋅fl(π)}if y is a zero, and x is −0 or x<0 = {sgn(y)⋅fl(π/2)}if x is a zero = {sgn(y)⋅fl(π/2)}if y is an infinity and x is finite = {sgn(y)⋅fl(3π/4)}if y is an infinity and x=−∞ = {sgn(y)⋅fl(π/4)}if y is an infinity and x=+∞ = {sgn(y)⋅fl(π)}if x=−∞ = {sgn(y)⋅0}if x=+∞ = {fl(θ)}otherwise\begin{array}{rcll} \APPLY(\kw{atan2},y,x) {\ }& = {\ }& \{\dbNaN\} {\quad}& \text{if}\ x\ \text{or}\ y\ \text{is}\ \dbNaN\\ {\ }& = {\ }& \{y\} {\quad}& \text{if}\ y\ \text{is a zero, and}\ x\ \text{is}\ +0\ \text{or}\ x>0\\ {\ }& = {\ }& \{\dbsgn(y)\cdot\dbfl(\dbpinum)\} {\quad}& \text{if}\ y\ \text{is a zero, and}\ x\ \text{is}\ -0\ \text{or}\ x<0\\ {\ }& = {\ }& \{\dbsgn(y)\cdot\dbfl(\dbpinum/2)\} {\quad}& \text{if}\ x\ \text{is a zero}\\ {\ }& = {\ }& \{\dbsgn(y)\cdot\dbfl(\dbpinum/2)\} {\quad}& \text{if}\ y\ \text{is an infinity and}\ x\ \text{is finite}\\ {\ }& = {\ }& \{\dbsgn(y)\cdot\dbfl(3\dbpinum/4)\} {\quad}& \text{if}\ y\ \text{is an infinity and}\ x=-\infty\\ {\ }& = {\ }& \{\dbsgn(y)\cdot\dbfl(\dbpinum/4)\} {\quad}& \text{if}\ y\ \text{is an infinity and}\ x=+\infty\\ {\ }& = {\ }& \{\dbsgn(y)\cdot\dbfl(\dbpinum)\} {\quad}& \text{if}\ x=-\infty\\ {\ }& = {\ }& \{\dbsgn(y)\cdot 0\} {\quad}& \text{if}\ x=+\infty\\ {\ }& = {\ }& \{\dbfl(\theta)\} {\quad}& \text{otherwise} \end{array}
Figure 52: APPLY\APPLY on Floats: Elementary Functions
Read it in its chapter·Permanent address: /standard/basis/Basics/atan2

Tests (1)

Discussions

Discuss this basis entry·Search the discussions on GitHub

Discussions are on GitHub; one about this basis entry has [b:Basics.atan2] 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.