sign

From DavinciWiki
Jump to: navigation, search

Description

Sign.

Arguments and Return Values

Arguments: One numeric array

Return Value: A numeric array containing the signs of each element of the input; sign is -1 if negative, 0 if zero, and 1 if positive; format of output is short, regardless of input format

If no arguments are input, sign() prints its description, as shown below.

Usage

Syntax: sign(x)

'x' - any numeric array

Examples

dv> sign()

sign(x) returns sign of input
1 if positive, -1 if negative, 0 if zero
Works for arrays
S.Marshall 12-07-2007

0
dv> sign(-2//-1//0//1//2)
5x1x1 array of short, bsq format [10 bytes]
-1      -1      0       1       1
dv> sign(pi)
1

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Major Sub-Functions

Recent Library Changes

Created On: 12-07-2007
Modified On: 01-17-2008

Personal tools