TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: CARLTON WALTERS
from: BOB STOUT
date: 1998-04-21 08:49:00
subject: could someone give an example of how to

On , Carlton Walters (1:250/536@fidonet) wrote: 
 > write a program that calculate the factorial of a entered integer.
 > I did this before but I forget.
Carlton...
  It's in SNIPPETS - see FACTORYL.C. Note, however, that if you're trying to 
crib a homework assignment, this isn't the code for you. Homework 
assignements typically as for either a recursive or non-recursive solution 
(or both, since the algorithm's trivial). The SNIPPETS function is more 
useful for real-life use since it returns the Log10 of the factorial rather 
than the value itself. Anything greater than 69! will overflow a typical 
pocket calculator which only goes up to 9.99...e+99. Your average C library, 
using doubles, can go as high can as 1.797...e+308, which will suffice to 
calculate only up to 170!
  The SNIPPETS version, OTOH, can easily be used to calculate things like 
permutations of 750,000 elements out of 1,000,000 - in fact the built in test 
harness does this as a demo. 
--- QM v1.00
---------------
* Origin: MicroFirm : Down to the C in chips (1:106/2000.6)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.