Skip to content

Commit 8e8b2e5

Browse files
authored
Fix pow error propagation for arrays.
1 parent b8db1d4 commit 8e8b2e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scinum/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2211,10 +2211,11 @@ def ensure_numpy(nom, unc):
22112211

22122212
# combined formula
22132213
if op == "**":
2214+
log_nom1 = infer_math(nom1).log(nom1)
22142215
return (
22152216
nom *
22162217
abs(nom2) * # type: ignore[arg-type]
2217-
(unc1**2.0 + (math.log(nom1) * unc2)**2.0 + 2 * rho * math.log(nom1) * unc1 * unc2)**0.5 # type: ignore[arg-type] # noqa
2218+
(unc1**2.0 + (log_nom1 * unc2)**2.0 + 2 * rho * log_nom1 * unc1 * unc2)**0.5 # type: ignore[arg-type] # noqa
22182219
)
22192220

22202221
# flip rho for sub and div

0 commit comments

Comments
 (0)