N. Chester,
Phase Transformations Group,
Department of Materials Science and Metallurgy,
University of Cambridge,
Cambridge, U.K.
Calculates the factorial of a natural number.
Language: | FORTRAN |
Product form: | Source code |
MAP_UTIL_FACT calculates N!, where N is a positive integer.
None supplied.
None.
Limited by number of significant figures permitted by double precison. This will affect the accuracy for large IY.
None.
DOUBLE PRECISION MAP_UTIL_FACT, FAX INTEGER IY READ (5,*) IY FAX = MAP_UTIL_FACT(IY) WRITE (6,10) IY 10 FORMAT ('The factorial of ',I4,' is ') WRITE (6,*) FAX STOP END
5
The factorial of 5 is 120.00
None.
factorial, natural number
MAP originated from a joint project of the National Physical Laboratory and the University of Cambridge.
MAP Website administration / map@msm.cam.ac.uk