User Tools

Site Tools


syntax:functions:sign

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
syntax:functions:sign [2016/06/20 11:58] dmitrysyntax:functions:sign [2021/08/11 15:35] (current) – [Examples] craigt
Line 1: Line 1:
-===== Sign(number) =====+====== Sign(number) =====
 +Category:  Number function
  
-Sign of a number. The sign of a number is 1 when the number is positive, and  −1 when the number is negative. The number zero is neither positive nor negativeand therefore has no sign.+\\  
 +=====Description===== 
 +This function determines whether //number// is positive, negative, or zero.  If positive the value 1 is returned.  If negative, the value -1 is returned If //number// is 0then 0 is returned.
  
- Example   Result  +\\  
-sign(85)   -1 | +=====Arguments===== 
-sign(0)  |  | +^Argument^Type^Description
-sign(125.1231)   |+|number|Number|The value being tested as positive, negative or zero.| 
 +\\  
 +**Return value type:**  Number (1, -1, or 0) 
 + 
 +\\  
 +=====Remarks===== 
 +An expression that results in a numeric answer can be used as the //number// argument.  In this case, the result of the expression is tested. 
 + 
 +\\  
 +=====Examples===== 
 + 
 +  sign(27) //Returns 1 
 + 
 +  sign(-42) //Returns -1 
 + 
 +  sign(0) //Returns 
 + 
 +  sign(14*-3//Returns -1 
 + 
 +  sign(88 * 0) //Returns 0 
 + 
 +  sign(12 * 3) //Returns 1
  
-Note: keep in mind that EasyMorph doesn't support unary minus in expressions - see Example 1 above. 
syntax/functions/sign.1466438303.txt.gz · Last modified: 2016/06/20 11:58 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki