Jump to content

User:Σ/Testing facility/Sgn/doc

From Wikipedia, the free encyclopedia

This template evaluates its numeric parameter and returns its mathematical sign. If the parameter is empty or missing, it returns an empty string. Otherwise, the return value is 1 if the parameter is positive, 0 if it is null, -1 if negative.

Syntax:
{{Σ/Testing facility/Sgn|value}}
Examples:
  • "{{Σ/Testing facility/Sgn|100}}" = "1".
  • "{{Σ/Testing facility/Sgn|0.1}}" = "1".
  • "{{Σ/Testing facility/Sgn|1-1}}" = "0".
  • "{{Σ/Testing facility/Sgn|-0.1}}" = "-1".
  • "{{Σ/Testing facility/Sgn|-100}}" = "-1".
  • "{{Σ/Testing facility/Sgn|}}" = "".