Skip to content

High percentile value raises error #289

@schlick

Description

@schlick

Using Math.percentile sometimes fails for a high percentile. Example:

require 'facets/math/percentile'
Math.percentile([1,2,3], 90)
NoMethodError: undefined method `-' for nil:NilClass
	from /Users/michael/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/facets-3.1.0/lib/standard/facets/math/percentile.rb:33:in `percentile'
	from (irb):4
	from /Users/michael/.rbenv/versions/2.3.6/bin/irb:11:in `<main>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions