Magnitude: Difference between revisions

Jump to navigation Jump to search
45 bytes added ,  22:10, 10 September 2022
m
Text replacement - "</source>" to "</syntaxhighlight>"
m (Text replacement - "<source" to "<syntaxhighlight")
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
Line 1: Line 1:
{{Built-in|Magnitude|<nowiki>|</nowiki>}}, or '''Absolute Value''', is a [[monadic]] [[scalar function]] which gives the [[wikipedia:Absolute value|absolute value]] of a real or [[complex]] number. Magnitude shares the [[glyph]] <syntaxhighlight lang=apl inline>|</source> with the dyadic arithmetic function [[Residue]].
{{Built-in|Magnitude|<nowiki>|</nowiki>}}, or '''Absolute Value''', is a [[monadic]] [[scalar function]] which gives the [[wikipedia:Absolute value|absolute value]] of a real or [[complex]] number. Magnitude shares the [[glyph]] <syntaxhighlight lang=apl inline>|</syntaxhighlight> with the dyadic arithmetic function [[Residue]].


== Examples ==
== Examples ==
Line 8: Line 8:
       |0J2 ¯3J¯4
       |0J2 ¯3J¯4
2 5
2 5
</source>
</syntaxhighlight>


== Properties ==
== Properties ==
Line 22: Line 22:
       (|v)=v÷×v
       (|v)=v÷×v
0 1 1 1 1 1 1
0 1 1 1 1 1 1
</source>
</syntaxhighlight>


For complex numbers, the magnitude is defined as the Euclidean distance from the number 0 on the [[wikipedia:Complex plane|complex plane]].
For complex numbers, the magnitude is defined as the Euclidean distance from the number 0 on the [[wikipedia:Complex plane|complex plane]].
Line 32: Line 32:
       |0 1J2 ¯3J4
       |0 1J2 ¯3J4
0 2.236067977 5
0 2.236067977 5
</source>{{Works in|[[Dyalog APL]]}}
</syntaxhighlight>{{Works in|[[Dyalog APL]]}}


Any real or complex number is equal to the [[Times|product]] of its [[signum]] and magnitude.
Any real or complex number is equal to the [[Times|product]] of its [[signum]] and magnitude.
Line 39: Line 39:
       (⊢ ≡ ××|) 0 1 1E¯300 ¯2.5 0J3.5 ¯3J¯4
       (⊢ ≡ ××|) 0 1 1E¯300 ¯2.5 0J3.5 ¯3J¯4
1
1
</source>{{Works in|[[Dyalog APL]]}}
</syntaxhighlight>{{Works in|[[Dyalog APL]]}}


== See also ==
== See also ==

Navigation menu