Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the rounding rule match the baseline #746

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ If you want to use a build not available via these channels, reach out to discus
* There is a maximum of 10,000 unique station names
* Line endings in the file are `\n` characters on all platforms
* Implementations must not rely on specifics of a given data set, e.g. any valid station name as per the constraints above and any data distribution (number of measurements per station) must be supported
* The rounding of output values must be done using the semantics of IEEE 754 rounding-direction "roundTowardPositive"
* The rounding of output values must be done by rounding to nearest, ties toward positive infinity. This does not quite match any of the IEEE 754 rounding-direction rules, but is what `Math.round()` does.

## Entering the Challenge

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/samples/measurements-rounding.out
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ham=14.6/25.5/33.6, jel=-9.0/18.0/46.5}
{a 1.050=1.0/1.1/1.1, a-1.050=-1.1/-1.0/-1.0, b 1.025=1.0/1.0/1.1, b-1.025=-1.1/-1.0/-1.0, c 1.075=1.0/1.1/1.1, c-1.075=-1.1/-1.1/-1.0, ham=14.6/25.5/33.6, jel=-9.0/18.0/46.5}
20 changes: 20 additions & 0 deletions src/test/resources/samples/measurements-rounding.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
a 1.050;1.0
a 1.050;1.1
a-1.050;-1.0
a-1.050;-1.1
b 1.025;1.0
b 1.025;1.0
b 1.025;1.0
b 1.025;1.1
b-1.025;-1.0
b-1.025;-1.0
b-1.025;-1.0
b-1.025;-1.1
c 1.075;1.0
c 1.075;1.1
c 1.075;1.1
c 1.075;1.1
c-1.075;-1.0
c-1.075;-1.1
c-1.075;-1.1
c-1.075;-1.1
ham;33.6
ham;31.7
ham;21.9
Expand Down