txt: ## abs.md
  abs
  
  Combined from primary sources listed below.
  
  # [In Complex](#___top "go to top of document")[§](#(Complex)_routine_abs "direct link")
  
  See primary documentation
  [in context](/type/Complex#routine_abs)
  for **routine abs**.
  
  ```raku
  method abs(Complex:D: --> Num:D)
  multi  abs(Complex:D $z --> Num:D)
  ```
  
  Returns the absolute value of the invocant (or the argument in sub form). For a given complex number `$z` the absolute value `|$z|` is defined as `sqrt($z.re * $z.re + $z.im * $z.im)`.
  
  ```raku
  say (3+4i).abs;                 # OUTPUT: «5␤»
                                  # sqrt(3*3 + 4*4) == 5
  ```
  
  # [In role Numeric](#___top "go to top of document")[§](#(role_Numeric)_routine_abs "direct link")
  
  See primary documentation
  [in context](/type/Numeric#routine_abs)
  for **routine abs**.
  
  ```raku
  multi        abs(Numeric:D  --> Real:D)
  multi method abs(Numeric:D: --> Real:D)
  ```
  
  Returns the absolute value of the number.
  
  # [In Cool](#___top "go to top of document")[§](#(Cool)_routine_abs "direct link")
  
  See primary documentation
  [in context](/type/Cool#routine_abs)
  for **routine abs**.
  
  ```raku
  sub abs(Numeric() $x)
  method abs()
  ```
  
  Coerces the invocant (or in the sub form, the argument) to [`Numeric`](/type/Numeric) and returns the absolute value (that is, a non-negative number).
  
  ```raku
  say (-2).abs;       # OUTPUT: «2␤»
  say abs "6+8i";     # OUTPUT: «10␤»
  ```
  