<commit_before>use v6;

use Test;

#L<S02/Built-In Data Types/Perl intrinsically supports big integers>

plan 48;
{
    my $a = 1; "$a";
    isa_ok($a, Int);
    is($a, "1", '1 stringification works');
}

{
    my $a = -1; "$a";
    isa_ok($a, Int);
    is($a, "-1", '-1 stringification works');
}

#L<S02/Built-In Data Types/Rat supports arbitrary precision rational arithmetic>
{
    my $a = 1 / 1;
    isa_ok($a, Rat);
    is(~$a, "1", '1/1 stringification works');
}

{
    my $a = -1.0;
    isa_ok($a, Num);
    is($a, "-1", '-1 stringification works');
}

{
    my $a = 0.1;<commit_msg>[t/spec] Test Num.perl.  Who'd have thought that 1.0.perl wouldn't work in Rakudo?<commit_after>use v6;

use Test;

#L<S02/Built-In Data Types/Perl intrinsically supports big integers>

plan 58;

#?rakudo todo "Num.perl doesn't report the decimal part if it is 0"
isa_ok( eval(1.Num.perl), Num, 'eval 1.Num.perl is Num' );
is_approx( eval(1.Num.perl), 1, 'eval 1.Num.perl is 1' );
#?rakudo todo "Num.perl doesn't report the decimal part if it is 0"
isa_ok( eval(0.Num.perl), Num, 'eval 0.Num.perl is Num' );
is_approx( eval(0.Num.perl), 0, 'eval 0.Num.perl is 0' );
#?rakudo todo "Num.perl doesn't report the decimal part if it is 0"
isa_ok( eval((-1).Num.perl), Num, 'eval -1.Num.perl is Num' );
is_approx( eval((-1).Num.perl), -1, 'eval -1.Num.perl is -1' );
isa_ok( eval(1.1.perl), Num, 'eval 1.1.Num.perl is Num' );
is_approx( eval(1.1.perl), 1.1, 'eval 1.1.Num.perl is 1.1' );
isa_ok( eval((-1.1).perl), Num, 'eval -1.1.Num.perl is Num' );
is_approx( eval((-1.1).perl), -1.1, 'eval -1.1.Num.perl is -1.1' );

{
    my $a = 1; "$a";
    isa_ok($a, Int);
    is($a, "1", '1 stringification works');
}

{
    my $a = -1; "$a";
    isa_ok($a, Int);
    is($a, "-1", '-1 stringification works');
}

#L<S02/Built-In Data Types/Rat supports arbitrary precision rational arithmetic>
{
    my $a = 1 / 1;
    isa_ok($a, Rat);
    is(~$a, "1", '1/1 stringification works');
}

{
    my $a = -1.0;
    isa_ok($a, Num);
    is($a, "-1", '-1 stringification works');
}

{
    my $a = 0.1;
{'fraction_non_alphanumeric': 0.20656370656370657, 'fraction_numerical': 0.04584942084942085, 'mean_word_length': 3.056751467710372, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7121543', 'n_tokens_mistral': 951, 'n_tokens_neox': 865, 'n_words': 250}