gregoa's blog
random musings about computers, life, and everything

2007-07-26 19:58:24 +0200
factorials
inspired by albert's experiments I took his script, changed it a bit [0], & calculated the factorial of 30.000 on my two boxen. results:
  • belanna: 46 seconds
  • nerys: 56 seconds
update 1: good old guinan needs 5 minutes & 3 seconds; still faster than chrisu's desktop machine :-)
& on our colleen the script takes 1 minute & 22 seconds to complete. update 2: the new guinan takes 1 minute & 48 seconds. wow. [0]
#!/bin/sh
[ "$#" != "1" ] && echo "Usage: $0 integer" && exit 1
STARTDATE=$(date)
echo "
define fac (x)
{
        res = 1
        while (x > 1)
        {
                res *=x;
                x -= 1;
        }
        return res;
}
fac ($1)
" | bc
ENDDATE=$(date)
echo "start: $STARTDATE"
echo "end: $ENDDATE"
exit 0
permalink | tags: computer

created by Chronicle v4.6

gregoa with debian swirl


tags
archives

weather

Temperature in Innsbruck

debian perl group

Logo Debian Perl Group © 2009, ghostbar, CC BY-NC-SA 2.0

copyright & license

Creative Commons License
All material on this blog — unless stated otherwise — is © gregor herrmann, and is licensed under the Creative Commons Attribution-Share Alike 3.0 Austria License.