Skip to content

Discuss: NaN and Infinity as results #4

@guyboertje

Description

@guyboertje

The current specs assert that a result is Infinity but the JSON spec forbids them.

Numeric values that cannot be represented in the grammar below (such as Infinity and NaN) are not permitted.

    describe "two huge numbers should multiply to infinity" do
      sample( "var1" => 1.79769313486232e+300,  "var2" => 1e+300 ) do
        expect( subject.get("result") ).to eq( Float::INFINITY )
      end
    end

How should we validate results of Float::INFINITY and Float::NAN before we set the result into the event?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions