Learn R Programming

readBrukerFlexData (version 1.3)

.double2singlePrecision: Converts double to single precision.

Description

This method simulate the conversion of floating point numbers from double precision (64bit, R: double(), C: double) to single precision (32bit, R: none, C: float). It is only needed for comparison between Bruker Daltonics' HPC and .hpc. It follows IEEE 754 standard: http://754r.ucbtest.org/standards/754.pdf This is an internal function and should normally not used by the user.

Usage

.double2singlePrecision(x)

Arguments

x
double. Numeric value which should reduce from double precision to single precision.

Value

  • double (in single precision).

Details

The same could be done in C by using casts: double precision32(double value) { float x = value; return (double)x; }

References

IEEE 754 standard http://754r.ucbtest.org/standards/754.pdf

See Also

.hpc

Examples

Run this code
## load library
library("readBrukerFlexData");

# more details
options(digits=22);

# a test number
num <- 1/3;

num;
readBrukerFlexData:::.double2singlePrecision(num);

Run the code above in your browser using DataLab