Skip to content

Commit

Permalink
Added fix to cfloat_endf for length 11 endf floats (#2967)
Browse files Browse the repository at this point in the history
Co-authored-by: aidancrilly <a.crilly16@imperial.ac.uk>
  • Loading branch information
aidancrilly and aidancrilly committed Apr 18, 2024
1 parent 2974d53 commit d53155d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion openmc/data/endf.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

double cfloat_endf(const char* buffer, int n)
{
char arr[12]; // 11 characters plus a null terminator
char arr[13]; // 11 characters plus e and a null terminator
int j = 0; // current position in arr
int found_significand = 0;
int found_exponent = 0;
Expand Down
1 change: 1 addition & 0 deletions tests/unit_tests/test_endf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def test_float_endf():
assert endf.float_endf('-1.+2') == approx(-100.0)
assert endf.float_endf(' ') == 0.0
assert endf.float_endf('9.876540000000000') == approx(9.87654)
assert endf.float_endf('-2.225002+6') == approx(-2.225002e+6)


def test_int_endf():
Expand Down

0 comments on commit d53155d

Please sign in to comment.