This resolves#219. When generating a new module, if all the files to
generate already exist then it fails as before. If some of the files
already exist, then the files that need to be created are created. Any
existing files are not changed.
Also added a bunch of tests for this feature via rspec. Run them from
the test folder with `rake spec`.
Takes about 10 minutes to run all floats, so split into 3 tests for parallel
running later. This was useful during development for finding hard corner cases
and getting the routine to high quality. Off by default.
Note that all floats 16.0 and up can be represented uniquely (in this format) and will
round-trip back to the exact same float with sscanf(). This property is true for
UnityPrintFloat, despite a few rounding error cases, it will produce output identity.
Better comments and refactor on round ties to even
Add upper threshold value on round to even feature since numerical precision issues
start to give approximations when dividing one large double by another. When tested
on float values, using 1e22 gave the fewest rounding errors.
Fix warnings from gcc. Some float constants do not behave well in existing tests.
Add casts where conversions could be imprecise.
Remove UNITY_FLOAT_VERBOSE entirely, add option UNITY_EXCLUDE_FLOAT_PRINT
Remove some questionable float casts from doubles
Default to Round Ties to Even behavior, add option to Round Ties Away from Zero
Improve printing six decimal places, remove trailing 0's, fix the carry when
numbers like 0.9999999 round up and print leading zeros in the decimal
The first attempt at printing floats had precision issues where the last few
digits would often be wrong. This next approach may yield a better algorithm
for numbers less than 4.29 billion, those that fit in 32 bits.
This fixes#220.
Removing strings from test files is still dangerous, but much
less likely to cause problems after this change to do the
removal after removing comments.
The bug could still manifest if a test file contains defines two
macros, one that contains a single quotation mark and then another
defined somewhere after it that contains a single quotation mark.
Everything in between the aforementioned quotation marks would
still be ignored after this commit, but that is an unlikely
scenario.