本文共 375 字,大约阅读时间需要 1 分钟。
class Complex{ constructor(real,imag){ this.real=real; this.imag=imag; } get phase(){ return Math.atan(this.imag/this.real)+(this.real<0?Math.PI:0); }}1/0==Infinity;//true1/-0==-Infinity;//true0==-0;//trueInfinity==-Infinity;//false(new Complex(0,-1).phase==new Complex(-0,-1).phase)==debug_for_one_more_hour;//true
转载地址:http://efkmf.baihongyu.com/