|
The manual says "Any positive integer X30." I'm curious what they mean by that. If you use 32 bit unsigned integers (10 u 0) for the input and output parms, you can't have a result greater than 2 ^ 32 (4294967296). 13! is a bit bigger ( 6227020800). My program gave me an answer of "13 factorial = 1932053504". If you subtract 2 ^ 32 from 13!, that's what you get. (I'm almost beginning to enjoy the windows calculator applet.) Integers roll over when you go past the maximum size. You could write your own using packed numbers. Amaze your friends with recursion in RPG. <BG> -----Original Message----- From: Dave Mahadevan [mailto:mahadevan@fuse.net] Sent: Tuesday, April 13, 1999 3:25 PM To: midrangel Subject: CEE4SIFAC Math API Folks: The API reference book says I can use this API upto number 30. The stuff starts giving me wrong answer from 13 . Did they mean 13 not 30? Has anybody used this API? +-------------------+-------------------+---------+------------------------- --------------+---------+---------------------------------------¦ ¦ Factorial ¦ CEE4SIFAC ¦ I ¦ n! = 1*2*3 ... (n-1)*n. ¦ 1 ¦ Any positive integer _30. ¦ +-------------------+-------------------+---------+------------------------- --------------+---------+---------------------------------------¦ -- Thank You. Regards Dave Mahadevan.. mailto:mahadevan@fuse.net +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.