Skip to content

Rounding for symmetric #17

@dmcclean

Description

@dmcclean
-- | Construct a symmetric interval.
--
-- >>> symmetric 3
-- -3 ... 3
symmetric :: Rounded TowardInf p -> Interval p
symmetric b = coerce (negate' b) ... b

But in intervals we had another test case:

-- >>> symmetric (-2)
-- -2 ... 2

I think both test cases belong, because that is (almost) the behavior of the definition for the rounded intervals too. If the negative input test case doesn't belong, then probably a test case saying that negative input is an exception does.

But I think this means that we need symmetric :: Rounded AwayFromZero p -> Interval p, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions