File: double2singlePrecision.Rd

package info (click to toggle)
r-cran-readbrukerflexdata 1.9.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,240 kB
  • sloc: sh: 13; makefile: 4
file content (54 lines) | stat: -rw-r--r-- 1,340 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/double2singlePrecision-functions.R
\name{.double2singlePrecision}
\alias{.double2singlePrecision}
\title{Converts double to single precision.}
\usage{
.double2singlePrecision(x)
}
\arguments{
\item{x}{\code{double}, numeric value which should reduce from double
precision to single precision.}
}
\value{
\code{double} (in single precision).
}
\description{
This function simulates the conversion of floating point numbers from double
precision (64bit, R: \code{double()}, C: \code{double}) to single precision
(32bit, R: \code{none}, C: \code{float}). It follows IEEE 754 standard.
}
\details{
The same could be done in C by using casts:
\preformatted{
double precision32(double value) {
  float x=value;
  return (double)x;
}}
}
\examples{
## 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)

}
\references{
IEEE 754 standard: \url{https://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=30711&filter=AND(p_Publication_Number:2355)}
}
\seealso{
\code{\link[readBrukerFlexData]{.changePrecision}},
 \code{\link[readBrukerFlexData]{.hpc}}
}
\keyword{internal}