mag

From DavinciWiki
Jump to: navigation, search

Description

Order of magnitude (power of 10).

Arguments and Return Values

Arguments: A numeric array (any format; negative values OK)

Return Value: A numeric array (format short) containing the magnitude of the input

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

Usage

Syntax: mag(x)

'x' - a numeric array (any format)

Examples

dv> mag()

Magnitude (power of 10) of input
mag(x) returns short(floor(log10(abs(x))))
Works for arrays
S.Marshall 12-06-2007

0
dv> mag(10//30//100//300//1000)
5x1x1 array of short, bsq format [10 bytes]
1       1       2       2       3
dv> mag(0.01//0.03//0.1//0.3//1.)
5x1x1 array of short, bsq format [10 bytes]
-2      -2      -1      -1      0
dv> mag(-1000//-10//0//100)
4x1x1 array of short, bsq format [8 bytes]
3       1       -32768  2

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

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

All other topics

  • See navigation on the left

Major Sub-Functions

Related Functions

Recent Library Changes

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

Personal tools