<commit_before>use strict;

use Test::More tests => 10;

use DateTime;

my $pos = DateTime::Infinite::Positive->new;
my $neg = DateTime::Infinite::Negative->new;

{
    # that's a long time ago!
    my $long_ago = DateTime->new( year => -100_000 );

    ok( $neg < $long_ago,
        'negative infinity is really negative' );

    my $far_future = DateTime->new( year => 100_000 );
    ok( $pos > $far_future,
        'positive infinity is really positive' );

    {
        local $::D=1;
        ok( 1,
            'positive infinity is bigger than negative infinity' );
    }
    my $pos_dur = $pos - $far_future;
    is( $pos_dur->is_positive, 1,
        'infinity - normal = infinity' );

    my $pos2 = $long_ago + $pos_dur;
    ok( $pos2 == $pos,
        'normal + infinite duration = infinity' );

    my $neg_dur = $far_future - $pos;
    is( $neg_dur->is_negative, 1,
        'normal - infinity = neg infinity' );

    my $neg2 = $long_ago + $neg_dur;
    ok( $neg2 == $neg,
        'normal + neg infinite duration = neg infinity' );

    my $dur = $pos - $pos;
    my %deltas = $dur->deltas;
    foreach ( qw( days seconds nanoseconds ) )
    {
        is( $deltas{$_}, 'nan', "infinity - infinity = nan ($_)" );
    }
}<commit_msg>use real Nan in comparisons, not string<commit_after>use strict;

use Test::More tests => 10;

use DateTime;

my $pos = DateTime::Infinite::Positive->new;
my $neg = DateTime::Infinite::Negative->new;
my $nan = $pos->{utc_rd_days} - $pos->{utc_rd_days};

{
    # that's a long time ago!
    my $long_ago = DateTime->new( year => -100_000 );

    ok( $neg < $long_ago,
        'negative infinity is really negative' );

    my $far_future = DateTime->new( year => 100_000 );
    ok( $pos > $far_future,
        'positive infinity is really positive' );

    {
        local $::D=1;
        ok( 1,
            'positive infinity is bigger than negative infinity' );
    }
    my $pos_dur = $pos - $far_future;
    is( $pos_dur->is_positive, 1,
        'infinity - normal = infinity' );

    my $pos2 = $long_ago + $pos_dur;
    ok( $pos2 == $pos,
        'normal + infinite duration = infinity' );

    my $neg_dur = $far_future - $pos;
    is( $neg_dur->is_negative, 1,
        'normal - infinity = neg infinity' );

    my $neg2 = $long_ago + $neg_dur;
    ok( $neg2 == $neg,
        'normal + neg infinite duration = neg infinity' );

    my $dur = $pos - $pos;
    my %deltas = $dur->deltas;
    foreach ( qw( days seconds nanoseconds ) )
    {
        is( $deltas{$_}, $nan, "infinity - infinity = nan ($_)" );
    }
}
{'fraction_non_alphanumeric': 0.15456674473067916, 'fraction_numerical': 0.01717408274785324, 'mean_word_length': 2.4823369565217392, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6764107', 'n_tokens_mistral': 970, 'n_tokens_neox': 886, 'n_words': 248}