mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Added fix to cfloat_endf for length 11 endf floats (#2967)
Co-authored-by: aidancrilly <a.crilly16@imperial.ac.uk>
This commit is contained in:
parent
2974d53b3c
commit
d53155d234
2 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue