toSeconds is sometimes inaccurate
@liyang is already working on this.
Since Jul 2, 2014.
Assessment
This issue has not been assessed yet.
Description
Currently implemented as:
toSeconds :: (TimeDiff t, Fractional n) => t -> n
toSeconds = (* recip 1000000) . fromIntegral . view microseconds
rather than
toSeconds = (/ 1000000) . fromIntegral . view microseconds
such that
> toSeconds (microseconds # 5 :: DiffTime) :: Double
4.9999999999999996e-6
even though a more accurate Double representation exists:
> 5 / 1000000 :: Double
5.0e-6
This can result in an error larger than 0.5us when calling toSeconds with durations of greater than microseconds # (2^32 * 1000000) (assuming 64-bit Double with 52 bits of mantissa), which is a little over 136 years. (Not entirely unreasonable; the first discrepancy is at 11us later.)
Won't fix for now as FDIV is significantly slower than FMUL: check the instruction tables PDF. Comment below if this causes any problems.
- Dominant language
- Haskell
- Stars
- 47
- Forks
- 35
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from haskell-github-trust/thyme
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
haskell-github-trust/thyme#82 · 1 comment ·
-
Dependency Dashboard Open
Difficulty 2/5 1-3 hours Newbie friendliness 20/100
All issues in haskell-github-trust/thyme
Similar issues
-
time-manager-0.4.0 Openfailure: bounds
Difficulty 1/5 Under an hour Newbie friendliness 72/100
commercialhaskell/stackage#8122 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
simplex-chat/simplex-chat#7547 ·
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 90/100
alunduil/alunduil-chezmoi#775 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
objectionary/phino#1350 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100