Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Product of a list of numbers?

by Zaxo (Archbishop)
on Jan 23, 2004 at 03:09 UTC ( #323420=note: print w/replies, xml ) Need Help??


in reply to Product of a list of numbers?

Your way is fine, but if you need more speed, look at PDL,

sub product { pdl( shift )->prodover; }
In the interest of speed, you'd probably want to work with piddles from the start, rather than converting like that.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: Product of a list of numbers?
by etj (Chaplain) on Jun 26, 2022 at 00:26 UTC
    Now the most idiomatic approach would be:
    PDL->topdl(shift)->prodover
    as topdl will not duplicate the data if it is already a pdl/ndarray.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://323420]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2022-10-06 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (26 votes). Check out past polls.

    Notices?