numbat icon indicating copy to clipboard operation
numbat copied to clipboard

Detect 0 raised to negative exponents

Open alexmo1997 opened this issue 1 year ago • 3 comments

For 0^-1, numbat gives inf as a result. However, 0^-1 should be equally undefined just as 1/0.

alexmo1997 avatar Jan 18 '25 10:01 alexmo1997

Yes, thank you for reporting this. I think we should probably catch this, but in general, we won't be able to turn all calculations that potentially return inf into runtime errors. Numbat is a numerical calculator and can not analytically determine in all cases if a calculations will result in inf/NaN.

sharkdp avatar Feb 16 '25 14:02 sharkdp

Hello @alexmo1997,

I made a PR to fix the issue.

yruellan avatar Apr 25 '25 21:04 yruellan

@sharkdp is my PR good?

yruellan avatar May 15 '25 13:05 yruellan