infusion / Complex.js

Complex.js is a com numbers library written in JavaScript
https://raw.org/article/complex-numbers-in-javascript/
MIT License
232 stars 33 forks source link

Modifies exp() and pow() and specs behaviour of z^inf and inf^z. #25

Open harrysarson opened 6 years ago

harrysarson commented 6 years ago

Previous behaviour was inconsistant and was not tested for. This commit ensures that z^inf and inf^z return reasonable and consistant values.

See #24 for the dicussion on the behaviour which can be summaried as:

z ^ Infinity === NaN
Infinity ^ z === Infinity if Im(z) === 0 and Re(z) > 0
Infinity ^ z === 0 if Re(z) < 0
Infinity ^ 0 === 1
Infinity ^ z === NaN otherwise
harrysarson commented 6 years ago

@infusion could you take a look?

harrysarson commented 6 years ago

@infusion I have solved the merge conflicts, would it be possible to review this?

harrysarson commented 5 years ago

@infusion any updates?