Difference between revisions of "Template:Sgn"
Jump to navigation
Jump to search
m (1 revision) |
(No difference)
|
Latest revision as of 17:53, 18 January 2010
[edit] [ ] Template documentation
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:
- {{Sgn|value}}
- Examples:
- "{{Sgn|100}}" = "1".
- "{{Sgn|0.1}}" = "1".
- "{{Sgn|1-1}}" = "0".
- "{{Sgn|-0.1}}" = "-1".
- "{{Sgn|-100}}" = "-1".
The above documentation is transcluded from Template:Sgn/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |