Fixed Point Rounding

Open
#679 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
haskell
Domain
backend

Research direction

Start with tests/builder/Data/ByteString/Builder/Tests.hs at the linked floating-point formatting test, then inspect formatDouble (standard places) and compare its expected behavior with showFFloat. Determine and document the intended result for 12.345 at two decimal places when rounding is exactly tied; done means the rounding rule is decided and the test reflects it.

Written by the indexing model from the issue text.

Description

A test for printing a floating point number of 12.345 with two decimal places checks for the result of "12.34". This matches with the result of showFFloat but @clyring is suggesting this is an error.

What should the result of formatDouble (standard places) be when it is the same distance to round up or down?

Dominant language
Haskell
Stars
302
Forks
146
Avg merge
7d 21h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from haskell/bytestring

All issues in haskell/bytestring

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.