.double2singlePrecision | R Documentation |
This function simulates the conversion of floating point numbers from double
precision (64bit, R: double()
, C: double
) to single precision
(32bit, R: none
, C: float
). It follows IEEE 754 standard.
.double2singlePrecision(x)
x |
|
The same could be done in C by using casts:
double precision32(double value) { float x=value; return (double)x; }
double
(in single precision).
IEEE 754 standard: https://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=30711&filter=AND(p_Publication_Number:2355)
.changePrecision
,
.hpc
## load library
library("readBrukerFlexData")
## show more details
oldDigits <- options()$digits
options(digits=22)
## a test number
num <- 1/3
num
readBrukerFlexData:::.double2singlePrecision(num)
## reset digits option
options(digits=oldDigits)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.