diff --git a/bower.json b/bower.json index 7066be2..be83181 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "complex.js", "main": "complex.js", - "version": "2.0.2", + "version": "2.0.3", "homepage": "https://github.com/infusion/Complex.js", "description": "A complex number library", "keywords": [ diff --git a/complex.js b/complex.js index 25c43df..d655b56 100644 --- a/complex.js +++ b/complex.js @@ -1,5 +1,5 @@ /** - * @license Complex.js v2.0.2 11/02/2016 + * @license Complex.js v2.0.3 11/02/2016 * * Copyright (c) 2016, Robert Eisele (robert@xarg.org) * Dual licensed under the MIT or GPL Version 2 licenses. @@ -374,6 +374,7 @@ var arg = Math.atan2(b, a); var loh = logHypot(a, b); + // If the exponent is real if (P['im'] === 0) { if (b === 0 && a >= 0) { diff --git a/complex.min.js b/complex.min.js index aca95b1..7f1e2fe 100644 --- a/complex.min.js +++ b/complex.min.js @@ -1,5 +1,5 @@ /* - Complex.js v2.0.2 11/02/2016 + Complex.js v2.0.3 11/02/2016 Copyright (c) 2016, Robert Eisele (robert@xarg.org) Dual licensed under the MIT or GPL Version 2 licenses. @@ -18,4 +18,4 @@ c=Math.cos(2*b)-f(2*a);return new d(-2*g(a)*Math.cos(b)/c,2*f(a)*Math.sin(b)/c)} a&&0===b,e=1-a,f=1+a,g=e*e+b*b,a=0!==g?new d((f*e-b*b)/g,(b*e+f*b)/g):new d(-1!==a?a/0:0,0!==b?b/0:0),b=a.re;a.re=m(a.re,a.im)/2;a.im=Math.atan2(a.im,b)/2;c&&(a.im=-a.im);return a},acoth:function(){var a=this.re,b=this.im;if(0===a&&0===b)return new d(0,Math.PI/2);var c=a*a+b*b;return 0!==c?(new d(a/c,-b/c)).atanh():(new d(0!==a?a/0:0,0!==b?-b/0:0)).atanh()},acsch:function(){var a=this.re,b=this.im;if(0===b)return new d(0!==a?Math.log(a+Math.sqrt(a*a+1)):Infinity,0);var c=a*a+b*b;return 0!==c?(new d(a/ c,-b/c)).asinh():(new d(0!==a?a/0:0,0!==b?-b/0:0)).asinh()},asech:function(){var a=this.re,b=this.im;if(0===a&&0===b)return new d(Infinity,0);var c=a*a+b*b;return 0!==c?(new d(a/c,-b/c)).acosh():(new d(0!==a?a/0:0,0!==b?-b/0:0)).acosh()},inverse:function(){var a=this.re,b=this.im,c=a*a+b*b;return new d(0!==a?a/c:0,0!==b?-b/c:0)},conjugate:function(){return new d(this.re,-this.im)},neg:function(){return new d(-this.re,-this.im)},ceil:function(a){a=Math.pow(10,a||0);return new d(Math.ceil(this.re*a)/ a,Math.ceil(this.im*a)/a)},floor:function(a){a=Math.pow(10,a||0);return new d(Math.floor(this.re*a)/a,Math.floor(this.im*a)/a)},round:function(a){a=Math.pow(10,a||0);return new d(Math.round(this.re*a)/a,Math.round(this.im*a)/a)},equals:function(a,b){k(a,b);return Math.abs(e.re-this.re)<=d.EPSILON&&Math.abs(e.im-this.im)<=d.EPSILON},clone:function(){return new d(this.re,this.im)},toString:function(){var a=this.re,b=this.im,c="";if(isNaN(a)||isNaN(b))return"NaN";0!==a&&(c+=a);0!==b&&(0!==a?c+=0>b?" - ": -" + ":0>b&&(c+="-"),b=Math.abs(b),1!==b&&(c+=b),c+="i");return c?c:"0"},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)}};d.ZERO=new d(0,0);d.ONE=new d(1,0);d.I=new d(0,1);d.PI=new d(Math.PI,0);d.E=new d(Math.E,0);d.EPSILON=1E-16;"function"===typeof define&&define.amd?define([],function(){return d}):"object"===typeof exports?module.exports=d:n.Complex=d})(this); +" + ":0>b&&(c+="-"),b=Math.abs(b),1!==b&&(c+=b),c+="i");return c?c:"0"},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)}};d.ZERO=new d(0,0);d.ONE=new d(1,0);d.I=new d(0,1);d.PI=new d(Math.PI,0);d.E=new d(Math.E,0);d.EPSILON=1E-16;"function"===typeof define&&define.amd?define([],function(){return d}):"object"===typeof exports?module.exports=d:n.Complex=d})(this); diff --git a/package.json b/package.json index b0bf5db..2ab60cf 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "homepage": "https://github.com/infusion/Complex.js", "bugs": "https://github.com/infusion/Complex.js/issues", "title": "complex.js", - "version": "2.0.2", + "version": "2.0.3", "description": "A complex number library", "keywords": ["complex numbers", "math", "complex", "number", "calculus", "parser", "arithmetic"], "author": "Robert Eisele (http://www.xarg.org/)",