allDigits(c("1231","89a8742")) # TRUE FALSE
isNumeric(c("1231","8.9e-2",".7d2")) # [1] TRUE TRUE FALSE
intToASCII(1:255)[121:129] # "x" "y" "z" "{" "|" "}" "~" "\177" "\200"
sapply(1:50,intToBase,2)
sapply(1:50,intToBase,7)
sapply(1:50,intToOct)
sapply(1:50,intToHex)
(pcf <- contfrac(pi)) # 3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, (1)
## last integer incorrect due to rounding errors
evalcfr(pcf)-pi # 0
str2dig("10010") # [1] 1 0 0 1 0
int(10^(7:10)) # 10000000 100000000 1000000000 NA
gcd(35,133) # 7
x <- exp(2.1)
xToBase(x,2);xToBase(x,3);xToBase(x,4) # 8.16617 = 1.02077*2^3 = 2.72206*3^1 = 2.04154*4^1
Hd( 12,25,17) # 12.421389
Hms(1.421389) # $h 1, $m 25, $s 17.0004
Hmsd(1.421389) # 1h 42m 13.89 -> 1.703858
Hdms(1.703858) # 1.421389
Degree(pi/2) # 90
Radian(180) # 3.141593
ReduceArc(580,360) # -140
ReduceArc2(200,120,70) # 130, 50
ReduceArc2(100,-200,70) # 310, 10
ToPolar(1.0, 1.0) # $r 1.41421, $p 0.785398
ToRect(2.0,pi) # $x -2, $y 2.44921e-16
Run the code above in your browser using DataLab