>  Docs Center  >  Libraries  >  Daithi  >  DECIMAL_PLACE
Libraries

DECIMAL_PLACE

DECIMAL_PLACE

Name


DECIMAL_PLACE

Purpose


This function returns the decimal place of the first significant
digit.

Category


Mathematics

Calling Sequence


Result = DECIMAL_PLACE( Xin )

Inputs


Xin: A scalar or vector of type floating point.

Keyword Parameters


GREATER: If set, the function returns negative values for numbers
outside the -1 to 1 range, indicating the placement of the
leading digit (e.g. "-2" for 100). The default is to return
"0" for such numbers.

Outputs


Result: The decimal place of the first significant digit. The
default is to return "0" for all numbers not between "-1" and
"1."

Procedure


This function determines the decimal place through a recursive
algorithm. For vectors the function calls itself for each
element.

Example


Calculate the decimal place of the first significant digit in
0.0123.
result = decimal_place( 0.0123 )

Modification History


  Written by: Daithi A. Stone, 2000-06-27.
Modified: DAS, 2000-07-06 (removed LENGTH.pro).
Modified: DAS, 2000-09-26 (added GREATER keyword).
Modified: DAS, 2000-11-29 (added numerical accuracy fix).
Modified: DAS, 2002-02-06 (fixed numerical accuracy fix)



© 2024 NV5 Geospatial Solutions, Inc. |  Legal
My Account    |    Contact Us