Difference between revisions of "SHIP:Sail:neg"

From Serious Documentation
Jump to: navigation, search
(Created page with "__NOTOC__ {{SailFuncTableStart|}}<onlyinclude> |{{SailFunc|neg}}||{{DataType|Integer}}/{{DataType|Float}}||style="text-align:center;"|v5.1.0||Return the negative of the given...")
 
Line 26: Line 26:
 
== Detailed Description ==
 
== Detailed Description ==
  
The <code>{{SailFunc|exp}}()</code> function returns the given number * -1.
+
The <code>{{SailFunc|neg}}()</code> function returns the given number * -1.
  
 
== Examples ==
 
== Examples ==
Line 34: Line 34:
 
! scope="col" style="text-align:left" | Notes
 
! scope="col" style="text-align:left" | Notes
 
|-
 
|-
|<code>{{SailFunc|neg}}(3.14);</code> || 3.14 ||
+
|<code>{{SailFunc|neg}}(3.14);</code> || 1.0 ||
 
|-
 
|-
 
|<code>{{SailFunc|neg}}(82);</code> || 82.0 ||
 
|<code>{{SailFunc|neg}}(82);</code> || 82.0 ||
 
|}
 
|}

Revision as of 16:53, 29 September 2016

Function Returns Introduced Description
neg Integer/Float v5.1.0 Return the negative of the given numberBadge SHIPv5.gif

See Also:

Prototype

Float neg(Integer n);

Parameters/Return Value

Parameter Data Type Description
n Integer/Float the number to negate
Return Float the result of -(n)

Detailed Description

The neg() function returns the given number * -1.

Examples

Example Result Notes
neg(3.14); 1.0
neg(82); 82.0