umvarma / pynastran

Automatically exported from code.google.com/p/pynastran
1 stars 0 forks source link

print_float_16 in fieldWriter16 produces output 1 char too long long for negative numbers #164

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What is the expected output? What do you see instead?

print_float_16 produces output 1 char too long (17 characters vs. 16) for 
negative numbers. Looks like a simple cut and paste error. Reducing the X value 
in the %16.X format specifiers fixes the problem. Patch 
(fieldWriter16.py.patch) and test script (test_print_float_16.py along with 
patched file fieldWriter16.py) are attached.

What version of the product are you using? On what operating system? 

r2249 on Windows 7

Original issue reported on code.google.com by jeffrey....@gmail.com on 3 Oct 2014 at 10:30

Attachments:

GoogleCodeExporter commented 9 years ago
I'm surprised that hadn't been caught.  Good catch.  The patch has been applied.

Additionally, a bug regarding 5.123e-10 dropping the trailing 0 has been fixed. 
 This was only an issue for large field, and not small field formatting.

Finally, tests have also been added regarding print_float_16 and print_float_8 
to make sure things don't break in the future.

Original comment by mesheb82 on 4 Oct 2014 at 7:02