You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ufloat_fromstr documentation does not mention how the function generates an uncertainty if the string representation does not contain one. Is it always 1 to the last significant digit? Also, I doubt that it makes sense to assign an uncertainty to a NaN value.
Examples:
ufloat_fromstr("123") -> 123.0+/-1.0
ufloat_fromstr("987") -> 987.0+/-1.0
ufloat_fromstr("0.9999") -> 0.9999+/-0.0001
ufloat_fromstr("nan") -> nan+/-1.0
The text was updated successfully, but these errors were encountered:
@Cs137 Yes, it does default to an uncertainty of 1 in the least significant digit. That seems like an OK behavior compared to the otherwise obvious default of "raise ValueError".
I would say the same about what to do with the string "nan": that result seems acceptable, though "raise ValueError" might be a better choice.
Adding a note and/or example about this in the docs as part of #285 would be fine.
The
ufloat_fromstr
documentation does not mention how the function generates an uncertainty if the string representation does not contain one. Is it always 1 to the last significant digit? Also, I doubt that it makes sense to assign an uncertainty to a NaN value.Examples:
ufloat_fromstr("123")
->123.0+/-1.0
ufloat_fromstr("987")
->987.0+/-1.0
ufloat_fromstr("0.9999")
->0.9999+/-0.0001
ufloat_fromstr("nan")
->nan+/-1.0
The text was updated successfully, but these errors were encountered: