in reply to Re: Improve my Code: Subroutines
in thread Improve my Code: Subroutines

my $r = ($i)*(1e-6);    #radii are in microns

Why do you put both factors in brackets?

Integers will be presented without any loss of precision in Perl

But only as long as the number "fits" into perls integer type, which typically is a 32 bit signed integer or 64 bit signed integer. Once you exceed the limit (+/- 231 resp. +/- 263), perl silently converts the value to a floating point number with loss of precision (perlnumber).

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^3: Improve my Code: Subroutines
by CountZero (Bishop) on Jun 14, 2009 at 15:56 UTC
    Why do you put both factors in brackets?
    I just copied it from the OP. There is no harm to using brackets here, they are just superfluous.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James