I think there might be another Win32ism at play here. At the start of the test file, there are the following lines (with their "value" after the comment):

        my $posinf = 100 ** 100 ** 100; # "1.#INF"
        my $neginf = -1 * $posinf;      # "-1.#INF"
        my $nan = $posinf - $posinf;    # "-1.#IND"

(I'm assuming that means INDeterminant), whereas the code

my $dur = $pos - $pos;

yields an object that looks like this:

$dur = bless( {
                "sign" => 0,
                "nanoseconds" => 0,
                "seconds" => "1.#QNAN",
                "eom_mode" => "wrap",
                "minutes" => 0,
                "months" => 0,
                "days" => "1.#QNAN"
              }, 'DateTime::Duration' );

I'm not sure why nanoseconds is 0; if I step through the DT::Duration->new() it looks exactly like seconds and days.

If you change the third line mentioned above like this:

my $nan = abs($posinf - $posinf); # "1.#QNAN"

then the two tests for seconds/days pass, but the nanoseconds fails since it is 0 and not "1.#QNAN" as it should be. Still investigating...

John

--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748



Reply via email to