Skip to content

floats: deflake Round test

Sebastien Binet requested to merge round-tests into master

Created by: kortschak

@btracey Please take a look.

This takes the table from TestRoundEven and changes the relevant want fields. Changed that differ between the two are

x: 454.4445, prec: 3
x: 454.44445, prec: 4
x: 0.425, prec: 2
x: 123.4245, prec: 3
x: 454.45, prec: 1
x: 454.445, prec: 2
x: 500, prec: -3

Fixes #114 (closed).

These tests are simpler and (as I discovered a couple of days ago - strconv.FormatFloat uses round half to even) actually correct.

Merge request reports