noExp {bigBits}R Documentation

Function to convert character-string numbers in exponential notation to "pure" integers.

Description

This is a helper function for base2base. When an input value is a character string with exponential notation, e.g., "2.65e4" , this function rebuilds the character string as a pure integer, e.g., "26500" . Decimal portions are removed.

Usage

noExp(x)

Arguments

x

An input character string, assumed only to contain numerals 0-9, "+,-,e,E" and the decimal separator character defined in the current locale.

Details

Both input and output must be base 10, as exponentiation in other bases is outside the current scope of this package.

Value

A character string representing the input as an integer written "longhand," i.e. no exponent. This string will contain only numerals and possibly a lead minus sign in the case of negative inputs.

Author(s)

Author and Maintainer:Carl Witthoft carl@witthoft.com

Examples


noExp('37e3')
noExp('-2.345e4')
# this returns zero
noExp('234e-5')

[Package bigBits version 1.3 Index]