ekmett / ekmett/rounded

Rounding for symmetric

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
35
Forks
13
PR merge metrics
No merged PRs in 30d

Description

```
-- | 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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.