Learn R Programming

goalprog (version 1.0-2)

fix.fp: Round floating point values that are with tolerance of integer

Description

This function returns a numeric value that is integer if it is within the specified tolerance of being integer. Otherwise, the given argument value is returned.

Usage

fix.fp(z, tol = 1e-04)

Arguments

z
A numeric floating or integer value
tol
The tolerance used to determine how close argument z is an integer

Value

  • A numeric value.

References

Ignizio, J. P. (1976). Goal Programming and Extensions, Lexington Books, D. C. Heath and Company.

See Also

llgptab

Examples

Run this code
fix.fp( 1.01 )
fix.fp( 1.001 )
fix.fp( 1.0001 )
fix.fp( 1.00001 )
fix.fp( 1.000001 )

Run the code above in your browser using DataLab