Signum: Difference between revisions

Jump to navigation Jump to search
79 bytes added ,  07:15, 9 July 2020
m (Text replacement - "{{APL built-ins}}" to "{{APL built-ins}}Category:Primitive functions")
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Built-in|Signum|×}}, '''Sign''', '''Sign of''', or '''Direction''' is a [[monadic]] [[primitive function]] which returns the [[wikipedia:Sign function|sign]] of a real or [[complex]] number. That is, it returns 0 when given an argument of 0, and otherwise returns a number with [[magnitude]] 1 given by [[Divide|dividing]] the argument by its own magnitude.
{{Built-in|Signum|×}}, '''Sign''', '''Sign of''', or '''Direction''' is a [[monadic]] [[scalar function]] which returns the [[wikipedia:Sign function|sign]] of a real or [[complex]] number. That is, it returns 0 when given an argument of 0, and otherwise returns a number with [[magnitude]] 1 given by [[Divide|dividing]] the argument by its own magnitude.


== Examples ==
== Examples ==
Line 29: Line 29:


The identity <source lang=apl inline>×z</source> {{←→}} <source lang=apl inline>z÷|z</source> holds only when <source lang=apl inline>z</source> is not zero in most APLs. In "Zero Divided by Zero"<ref>[[Eugene McDonnell|McDonnell, Eugene]]. [https://www.jsoftware.com/papers/eem/0div0.htm "Zero Divided by Zero"]. [[APL76]].</ref>, [[Eugene McDonnell]] gave this identity as a reason to define <source lang=apl inline>0÷0</source> to be equal to <source lang=apl inline>0</source>. In [[J]], which took McDonnell's suggestion, the identity always holds. [[Dyalog APL]] and [[NARS2000]] allow the choosing [[division method]] though the default remains 1.
The identity <source lang=apl inline>×z</source> {{←→}} <source lang=apl inline>z÷|z</source> holds only when <source lang=apl inline>z</source> is not zero in most APLs. In "Zero Divided by Zero"<ref>[[Eugene McDonnell|McDonnell, Eugene]]. [https://www.jsoftware.com/papers/eem/0div0.htm "Zero Divided by Zero"]. [[APL76]].</ref>, [[Eugene McDonnell]] gave this identity as a reason to define <source lang=apl inline>0÷0</source> to be equal to <source lang=apl inline>0</source>. In [[J]], which took McDonnell's suggestion, the identity always holds. [[Dyalog APL]] and [[NARS2000]] allow the choosing [[division method]] though the default remains 1.
== See also ==
* [[Negate]]
* [[Conjugate]]


== External links ==
== External links ==
Line 40: Line 44:
== References ==
== References ==
<references />
<references />
{{APL built-ins}}[[Category:Primitive functions]]
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]]

Navigation menu