Signum: Difference between revisions

Jump to navigation Jump to search
212 bytes added ,  07:15, 9 July 2020
(Created page with "{{Built-in|Signum|×}}, '''Sign''', '''Sign of''', or '''Direction''' is a monadic primitive function which returns the sign of a real or [...")
 
(5 intermediate revisions by 3 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 28: Line 28:
== Zero divided by zero ==
== Zero divided by zero ==


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.
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}}
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]]

Navigation menu