Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3225498
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:20:47+00:00 2026-05-17T16:20:47+00:00

use strict; use warnings; use Statistics::Descriptive; use 5.012; my @data = ( -2, 7,

  • 0
use strict;
use warnings;
use Statistics::Descriptive;
use 5.012;

my @data = ( -2, 7, 7, 4, 18, -5 );
my $stat = Statistics::Descriptive::Full->new();
$stat->add_data(@data);
say ($stat->percentile(100) // "undef"); # return 18. OK.
say ($stat->percentile(0) // "undef"); # return undef instead of "-inf". see doc below

Statistics::Descriptive doc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:20:47+00:00Added an answer on May 17, 2026 at 4:20 pm

    Same outcome on ActiveState 5.12.2 64-bit on a Windows platform. You answered your own question: it does not work as documented.

    #!/usr/bin/perl -w
    use strict;
    use warnings;
    use Statistics::Descriptive;
    use Math::Bigint;
    
    use 5.012;
    
    my @data = ( -2, 7, 7, 4, 18, -5 );
    my $stat = Statistics::Descriptive::Full->new();
    $stat->add_data(@data);
    say(Math::BigInt->is_inf($stat->percentile(0)));
    

    returns 0

    Edit : as rafl points out, on a Windows system perl -e "print(9**9**9);" will give 1.#INF instead of inf. As inf apparently isn’t implemented yet in my version, the Statistics package won’t be able to return inf and returns undefined instead.

    Edit2 : As it turns out OP works on Linux and can return inf, the error is probably inherent to the Statistics::Descriptive package.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#!/usr/bin/env perl use warnings; use strict; use 5.012; use XML::LibXML::Reader; my $reader = XML::LibXML::Reader->new(
Consider this snippet: use strict; use warnings; my $data = 1; my $packed =
#!/usr/bin/env perl use warnings; use strict; use 5.012; use IPC::System::Simple qw(system); system( 'xterm', '-geometry',
I'm puzzled with this test script: #!perl use strict; use warnings; use encoding 'utf8';
Consider the following code and its output: Code #!/usr/bin/perl -w use strict; use Data::Dumper;
#!/usr/bin/perl use strict; use warnings; my @array = qw[a b c]; foreach my($a,$b,$c) (@array)
#!/usr/bin/perl use strict; use warnings; open(my $vmstat, /usr/bin/vmstat 1 2>&1 |); open(my $foo, >,
#!usr/bin/perl use strict; use warnings; my $file_name = rem.txt; open(FILE, $file_name); while (<FILE>) {
!/usr/bin/env perl use warnings; use strict; my $text = 'hello ' x 30; printf
Version #1 use warnings; use strict; my $count = 4; for $count (1..8) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.