“Provide the sign of various numbers.”
System. |
The signum()
method determines the sign of a number, with 1 indicating positivity, -1 indicating negativity, and 0 representing zero.
|
|
Parameter |
Description |
number |
“Necessary. A number for which the sign needs to be determined.” |
Returns: |
A double or float value indicating the sign of a number, returning 1 for positive numbers, -1 for negative numbers, and 0 for zero. |
Java Version: |
1.5+ |