in reply to Re: Average Time?
in thread Average Time?

And the same with error handling:

use List::Util 'sum'; my $avg = @times ? sum(@times)/@times : "NaN";

As I just discovered w/ some help on CB, don't expect the above "NaN" to be NaN on MS. s/"NaN"/1e9999\/1e9999/ for portable (and less readable) support there.

Update: ikegami is of course right that it's a C lib problem, not OS dependent, but that does not change that there are potential NaN portability issues.

Replies are listed 'Best First'.
Re^3: Average Time?
by ikegami (Patriarch) on Jan 27, 2009 at 16:49 UTC
    NaN support is based on the underlying C lib, not the OS.