 
 # normal density
 dnorm = (x, mu=0, sd=1) ->
+    x = parseFloat(x)
+    mu = parseFloat(mu)
+    sd = parseFloat(sd)
     if sd <= 0
         console.log("dnorm: sd must be positive")
         return null


# quantile of t distribution by binary search
qt = (p, df, hi=5, tol=0.0001) ->
    if df <= 0
        console.log("qt: df must be positive")
        return null


# quantile of normal distribution
qnorm = (p, mu=0, sd=1) ->
    p = parseFloat(p)
    mu = parseFloat(mu)
    sd = parseFloat(sd)
    if sd <= 0
        console.log("qnorm: sd must be positive")
        return null
