ElectrifyPro/big-complex.js ? reverse-engineered prompt

Reverse engineered prompt

Build me a small JavaScript library for arbitrary precision complex numbers, similar to the one in the README.

I want to be able to create complex values from numbers or strings, do basic math like add, subtract, multiply, divide, and reciprocal, and also have higher level functions like power, natural log, exponential, and trig functions such as asin and asech. It should keep precision much better than normal JavaScript numbers, and the results should print in a clean readable way like Complex { re: ..., im: ... }.

Make it easy to use with both CommonJS and ES module imports, and include a simple README style usage example that shows a few real cases. Use the decimal.js approach for precision if that fits, and look up current docs online if you need to.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab