diff --git a/l1/1.jl b/l1/1.jl index 69b15d8..0c53aa9 100755 --- a/l1/1.jl +++ b/l1/1.jl @@ -9,9 +9,9 @@ Calculate the machine epsilon iteratively for the given IEEE 754 floating point type. # Arguments -- `T`: a floating point number type <: AbstractFloat +- `T`: the floating point type """ -function macheps(T) +function macheps(T::Type{<: AbstractFloat}) one_T = one(T) ret = one_T while one_T + (ret / T(2)) > one_T @@ -28,9 +28,9 @@ Calculate the eta number iteratively for the given IEEE 754 floating point type. # Arguments -- `T`: a floating point number type <: AbstractFloat +- `T`: the floating point type """ -function eta(T) +function eta(T::Type{<: AbstractFloat}) ret = one(T) while ret / T(2) > zero(T) @@ -47,9 +47,9 @@ Calculate the largest possible value for the given IEEE 754 floating type. # Arguments -- `T`: a floating point number type <: AbstractFloat +- `T`: the floating point type """ -function max(T) +function max(T::Type{<: AbstractFloat}) ret = one(T) while isfinite(ret * T(2))