Home »
Public Forums »
archive »
Re: factorial in PV-WAVE
Re: factorial in PV-WAVE [message #8746] |
Fri, 11 April 1997 00:00 |
dan
Messages: 27 Registered: March 1993
|
Junior Member |
|
|
In article <5ilsb9$d2r@ovid.dra.hmg.gb>, black@signal.dra.hmg.gb (John Black) writes:
|> Am I misssing something, but in PV-WAVE (we're still on version 5 here) is
|> there no supplied factorial function, ie a function or operator that performs
|> for integer n the product of all the integers between 1 and n?
|>
|> If there isn't this is an omission. Is this omission corrected in later
|> versions of PV-WAVE?
|>
|> Also there doesn't seem to be a function that takes the product of the numbers
|> in an array.
|>
|> Ok these things can be easily written, but it does seem an astounding omission!
|>
|> John Black.
|>
|>
|>
How about
a = findgen(10) + 1.
afactorial = exp(total(alog(a)))
--
************************************************************ ***
** Dan Bergmann dbergmann@llnl.gov **
** Atmospheric Science Division fax (510) 423-4908 **
** Lawrence Livermore National Lab human (510) 423-6765 **
|
|
|
Current Time: Sun Oct 12 06:04:10 PDT 2025
Total time taken to generate the page: 1.89769 seconds