Skip to end of banner
Go to start of banner

fact

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Availability

This routine is available since katl-commons 2.5 .


Syntax:

fact(number)

Description:

Returns the factorial of a number.
The factorial of a number n is equal to 1*2*3*...* n

Parameters:

ParameterTypeRequiredDescription
numberNumberYesThe non-negative number for which you want the factorial. If number is not an integer, it is truncated.

Return type:

number

Example:

number a = fact(5);
print("a= " + a);

number b = fact(3.7);
print("b= " + b);

number c = fact(-3);
print("c= " + c);

Prints:

        a= 120 ;

        b= 6;

        c= NaN;


 

See Also:

 


  • No labels