<commit_before>use v6;
use Test;
plan 6;

# L<S32::Numeric/Num/"Num provides a number of constants">

=begin pod

=head1 DESCRIPTION

Basic tests for builtin Num::pi

=end pod


# See also: L<"http://theory.cs.iitm.ernet.in/~arvindn/pi/"> :)
my $PI = 3.14159265358979323846264338327950288419716939937510e0;

#?rakudo 6 skip 'module Num not implemented'
is_approx(Num::pi, $PI, "Num::pi");

is_approx(eval("use Num :constants; pi"), $PI, 
                        "pi imported by use Num :constants");  

is_approx(eval("use Num :constants; 3 + pi()"), $PI+3, "
                        3+pi(), as a sub");

is_approx(eval("use Num :constants; pi() + 3"), $PI+3,
                        "pi()+3, as a sub");

is_approx(eval("use Num :constants; 3 + pi"),   $PI+3, 
                        "3+pi, as a bareword");

is_approx(eval("use Num :constants; pi + 3"),   $PI+3, <commit_msg>[t/spec] Note that tests being skipped are out of sync with the spec.<commit_after>use v6;
use Test;
plan 6;

# L<S32::Numeric/Num/"Num provides a number of constants">

=begin pod

=head1 DESCRIPTION

Basic tests for builtin Num::pi

=end pod


# See also: L<"http://theory.cs.iitm.ernet.in/~arvindn/pi/"> :)
my $PI = 3.14159265358979323846264338327950288419716939937510e0;

#?rakudo 6 skip 'module Num not implemented (and the spec has changed)'
is_approx(Num::pi, $PI, "Num::pi");

is_approx(eval("use Num :constants; pi"), $PI, 
                        "pi imported by use Num :constants");  

is_approx(eval("use Num :constants; 3 + pi()"), $PI+3, "
                        3+pi(), as a sub");

is_approx(eval("use Num :constants; pi() + 3"), $PI+3,
                        "pi()+3, as a sub");

is_approx(eval("use Num :constants; 3 + pi"),   $PI+3, 
                        "3+pi, as a bareword");

is_approx(eval("use Num :constants; pi + 3"),   $PI+3, 
{'fraction_non_alphanumeric': 0.16421968461120173, 'fraction_numerical': 0.07504078303425775, 'mean_word_length': 2.9316239316239314, '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': '2913121', 'n_tokens_mistral': 761, 'n_tokens_neox': 672, 'n_words': 189}