 
 # t density
 dt = (x, df) ->
+    x = parseFloat(x)
+    df = parseFloat(df)
     if df <= 0
         console.log("dt: df 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


# 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
