On Tuesday, January 13, 2015 at 12:04:49 AM UTC-5, Ivar Nesje wrote:
>
> Octave uses Float64 numbers by default, so factorial(20) in octave is 
> equivalent to factorial(20.0) in Julia.


Although we don't currently define factorial for non-integer values, you 
can use the gamma function with floating-point values via the identity 
gamma(n+1) == factorial(n).

So, you could do gamma(22.0) to compute factorial(21) approximately in 
floating-point.

I'm not sure why we don't just have a
     factorial(x::FloatingPoint) = gamma(x+1)
method. 

Reply via email to