Printing floating points
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Tue Jan 26 20:27:25 UTC 2021
On Tuesday, 26 January 2021 at 19:02:53 UTC, Bruce Carneal wrote:
> If you can construct a tractable exhaustive proof of an
> implementation, which is what I believe you asserted in this
> case, then you don't need any other proof.
Of course you do, you need proof of the tests being correct...
> can be skipped is tantamount to saying that you know the
> implementation performs correctly in those regions.
In general, if one understands the algorithm as implemented then
one can either manually or automatically prove certain
regions/ranges. Then you only need to test the regions/ranges
that are hard to prove.
For instance, for a converter from int to string, the most likely
failure point will be tied to crossing between "9" and "0" as
well as the ends of the base-2 input. Meaning, if it works for
1,2,3, you know that it also works for 4,5,6,7,8, but maybe not
9,10.
More information about the Digitalmars-d
mailing list