x1 <- c(NA, NaN, -Inf, Inf, 0, pi*10^(-20:20))
fcvt(x1)
x2 <- c(-0.36, 3.6, -30.6, 0.36)
fcvt(x2)
x3 <- c((0:16)/8, 1/3)
fcvt(x3) # as floating point number, equals denom=-1
fcvt(x3, denom=0) # as floating point or fractional number
fcvt(x3, denom=1) # as fractional number except for integers
fcvt(x3, denom=8) # as fractional number with denominator denom if possible
Run the code above in your browser using DataLab