Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0041073 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] A. Platform | minor | have not tried | 2019-06-12 08:35 | 2019-08-22 14:45 | |||
Reporter | alostale | View Status | public | |||||
Assigned To | alostale | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | 3.0PR19Q4 | |||
Status | closed | Fix in branch | Fixed in SCM revision | ce9737beff16 | ||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | ||||||||
Review Assigned To | caristu | |||||||
OBNetwork customer | No | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0041073: BigDecimal.js uses deprecated Function.arguments | |||||||
Description | BigDecimal JavaScript library, used in backoffice (org.openbravo.client.kernel) and in mobile applications (org.openbravo.mobile.core) makes use of Function.arguments which is a deprecated JavaScript feature that might be removed in future [1]. [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/arguments [^] | |||||||
Steps To Reproduce | - | |||||||
Proposed Solution | Possible alternatives: 1. Update this library to a version not using it. Note there are no updates for years now [1]. 2. Fix current version not to make use of it. Repo forked here [2] 3. Look for a replacement library [1] https://github.com/latentflip/BigDecimal.js [^] [2] https://github.com/alostale/BigDecimal.js [^] | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() comparing with https://code.openbravo.com/erp/devel/pi/ searching for changes changeset: 36223:b47fe8e7b239 tag: tip user: Carlos Aristu <carlos.aristu@openbravo.com> date: Fri Jul 05 08:49:36 2019 +0200 summary: BigDecimal diff --git a/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/js/BigDecimal-all-1.0.1.min.js b/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/js/BigDecimal-all-1.0.1.min.js deleted file mode 100644 --- a/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/js/BigDecimal-all-1.0.1.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/*! - * Copyright (c) 2011 Daniel Trebbien - * Portions Copyright (c) 2003 STZ-IDA and PTV AG, Karlsruhe, Germany - * Portions Copyright (c) 1995-2001 International Business Machines Corporation and others - * - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. - */ -var BigDecimal=(function(){j.prototype.getDigits=y;j.prototype.getForm=g;j.prototype.getLostDigits=a;j.prototype.getRoundingMode=z;j.prototype.toString=e;j.prototype.isValidRound=P;j.prototype.PLAIN=0;j.prototype.SCIENTIFIC=1;j.prototype.ENGINEERING=2;j.prototype.ROUND_CEILING=2;j.prototype.ROUND_DOWN=1;j.prototype.ROUND_FLOOR=3;j.prototype.ROUND_HALF_DOWN=5;j.prototype.ROUND_HALF_EVEN=6;j.prototype.ROUND_HALF_UP=4;j.prototype.ROUND_UNNECESSARY=7;j.prototype.ROUND_UP=0;j.prototype.DEFAULT_FORM=j.prototype.SCIENTIFIC;j.prototype.DEFAULT_DIGITS=9;j.prototype.DEFAULT_LOSTDIGITS=false;j.prototype.DEFAULT_ROUNDINGMODE=j.prototype.ROUND_HALF_UP;j.prototype.MIN_DIGITS=0;j.prototype.MAX_DIGITS=999999999;j.prototype.ROUNDS=new Array(j.prototype.ROUND_HALF_UP,j.prototype.ROUND_UNNECESSARY,j.prototype.ROUND_CEILING,j.prototype.ROUND_DOWN,j.prototype.ROUND_FLOOR,j.prototype.ROUND_HALF_DOWN,j.prototype.ROUND_HALF_EVEN,j.prototype.ROUND_UP);j.prototype.ROUNDWORDS=new Array("ROUND_HALF_UP","ROUND_UNNECESSARY","ROUND_CEILING","ROUND_DOWN","ROUND_FLOOR","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_UP");j.prototype.DEFAULT=new j(j.prototype.DEFAULT_DIGITS,j.prototype.DEFAULT_FORM,j.prototype.DEFAULT_LOSTDIGITS,j.prototype.DEFAULT_ROUNDINGMODE);function j(){this.digits=0;this.form=0;this.lostDigits=false;this.roundingMode=0;var T=this.DEFAULT_FORM;var W=this.DEFAULT_LOSTDIGITS;var V=this.DEFAULT_ROUNDINGMODE;if(j.arguments.length==4){T=j.arguments[1];W=j.arguments[2];V=j.arguments[3]}else{if(j.arguments.length==3){T=j.arguments[1];W=j.arguments[2]}else{if(j.arguments.length==2){T=j.arguments[1]}else{if(j.arguments.length!=1){throw"MathContext(): "+j.arguments.length+" arguments given; expected 1 to 4"}}}}var U=j.arguments[0];if(U!=this.DEFAULT_DIGITS){if(U<this.MIN_DIGITS){throw"MathContext(): Digits too small: "+U}if(U>this.MAX_DIGITS){throw"MathContext(): Digits too large: "+U}}if(T==this.SCIENTIFIC){}else{if(T==this.ENGINEERING){}else{if(T==this.PLAIN){}else{throw"MathContext() Bad form value: "+T}}}if((!(this.isValidRound(V)))){throw"MathContext(): Bad roundingMode value: "+V}this.digits=U;this.form=T;this.lostDigits=W;this.roundingMode=V;return}function y(){return this.digits}function g(){return this.form}function a(){return this.lostDigits}function z(){return this.roundingMode}function e(){var W=null;var V=0;var U=null;if(this.form==this.SCIENTIFIC){W="SCIENTIFIC"}else{if(this.form==this.ENGINEERING){W="ENGINEERING"}else{W="PLAIN"}}var T=this.ROUNDS.length;V=0;V:for(;T>0;T--,V++){if(this.roundingMode==this.ROUNDS[V]){U=this.ROUNDWORDS[V];break V}}return"digits="+this.digits+" form="+W+" lostDigits="+(this.lostDigits?"1":"0")+" roundingMode="+U}function P(U){var T=0;var V=this.ROUNDS.length;T=0;T:for(;V>0;V--,T++){if(U==this.ROUNDS[T]){return true}}return false}function O(U,T){return(U-(U%T))/T}o.prototype.div=O;function t(Y,X,T,W,V){var U;if(W>X){for(U=V-1;U>=0;--U){T[U+W]=Y[U+X]}}else{for(U=0;U<V;++U){T[U+W]=Y[U+X]}}}o.prototype.arraycopy=t;function n(U){var V=new Array(U);var T;for(T=0;T<U;++T){V[T]=0}return V}o.prototype.createArrayWithZeros=n;o.prototype.abs=F;o.prototype.add=c;o.prototype.compareTo=Q;o.prototype.divide=v;o.prototype.divideInteger=d;o.prototype.max=u;o.prototype.min=S;o.prototype.multiply=r;o.prototype.negate=l;o.prototype.plus=b;o.prototype.pow=B;o.prototype.remainder=w;o.prototype.subtract=h;o.prototype.equals=A;o.prototype.format=E;o.prototype.intValueExact=i;o.prototype.movePointLeft=I;o.prototype.movePointRight=L;o.prototype.scale=H;o.prototype.setScale=x;o.prototype.signum=K;o.prototype.toString=e;o.prototype.layout=G;o.prototype.intcheck=M;o.prototype.dodivide=D;o.prototype.bad=R;o.prototype.badarg=C;o.prototype.extend=k;o.prototype.byteaddsub=s;o.prototype.diginit=f;o.prototype.clone=p;o.prototype.checkdigits=J;o.prototype.round=N;o.prototype.allzero=q;o.prototype.finish=m;o.prototype.ROUND_CEILING=j.prototype.ROUND_CEILING;o.prototype.ROUND_DOWN=j.prototype.ROUND_DOWN;o.prototype.ROUND_FLOOR=j.prototype.ROUND_FLOOR;o.prototype.ROUND_HALF_DOWN=j.prototype.ROUND_HALF_DOWN;o.prototype.ROUND_HALF_EVEN=j.prototype.ROUND_HALF_EVEN;o.prototype.ROUND_HALF_UP=j.prototype.ROUND_HALF_UP;o.prototype.ROUND_UNNECESSARY=j.prototype.ROUND_UNNECESSARY;o.prototype.ROUND_UP=j.prototype.ROUND_UP;o.prototype.ispos=1;o.prototype.iszero=0;o.prototype.isneg=-1;o.prototype.MinExp=-999999999;o.prototype.MaxExp=999999999;o.prototype.MinArg=-999999999;o.prototype.MaxArg=999999999;o.prototype.plainMC=new j(0,j.prototype.PLAIN);o.prototype.bytecar=new Array((90+99)+1);o.prototype.bytedig=f();o.prototype.ZERO=new o("0");o.prototype.ONE=new o("1");o.prototype.TEN=new o("10");function o(){this.ind=0;this.form=j.prototype.PLAIN;this.mant=null;this.exp=0;if(o.arguments.length==0){return}var ai;var ab;var Z;if(o.arguments.length==1){ai=o.arguments[0];ab=0;Z=ai.length}else{ai=o.arguments[0];ab=o.arguments[1];Z=o.arguments[2]}if(typeof ai=="string"){ai=ai.split("")}var ad;var ah;var ak;var ao;var ac;var ag=0;var an=0;var T=false;var ae=0;var aj=0;var af=0;var am=0;var al=0;var V=0;if(Z<=0){this.bad("BigDecimal(): ",ai)}this.ind=this.ispos;if(ai[0]==("-")){Z--;if(Z==0){this.bad("BigDecimal(): ",ai)}this.ind=this.isneg;ab++}else{if(ai[0]==("+")){Z--;if(Z==0){this.bad("BigDecimal(): ",ai)}ab++}}ad=false;ah=false;ak=0;ao=-1;ac=-1;var aa=Z;ag=ab;ag:for(;aa>0;aa--,ag++){an=ai[ag];if(an>="0"){if(an<="9"){ac=ag;ak++;continue ag}}if(an=="."){if(ao>=0){this.bad("BigDecimal(): ",ai)}ao=ag-ab;continue ag}if(an!="e"){if(an!="E"){if(an<"0"||an>"9"){this.bad("BigDecimal(): ",ai)}ad=true;ac=ag;ak++;continue ag}}if((ag-ab)>(Z-2)){this.bad("BigDecimal(): ",ai)}T=false;if((ai[ag+1])==("-")){T=true;ae=ag+2}else{if((ai[ag+1])==("+")){ae=ag+2}else{ae=ag+1}}aj=Z-((ae-ab));if((aj==0)||(aj>9)){this.bad("BigDecimal(): ",ai)}var Y=aj;af=ae;af:for(;Y>0;Y--,af++){am=ai[af];if(am<"0"){this.bad("BigDecimal(): ",ai)}if(am>"9"){this.bad("BigDecimal(): ",ai)}else{al=am-"0"}this.exp=(this.exp*10)+al}if(T){this.exp=-this.exp}ah=true;break ag}if(ak==0){this.bad("BigDecimal(): ",ai)}if(ao>=0){this.exp=(this.exp+ao)-ak}var X=ac-1;ag=ab;ag:for(;ag<=X;ag++){an=ai[ag];if(an=="0"){ab++;ao--;ak--}else{if(an=="."){ab++;ao--}else{if(an<="9"){break ag}else{break ag}}}}this.mant=new Array(ak);af=ab;if(ad){exotica:do{var W=ak;ag=0;ag:for(;W>0;W--,ag++){if(ag==ao){af++}am=ai[af];if(am<="9"){this.mant[ag]=am-"0"}else{this.bad("BigDecimal(): ",ai)}af++}}while(false)}else{simple:do{var U=ak;ag=0;ag:for(;U>0;U--,ag++){if(ag==ao){af++}this.mant[ag]=ai[af]-"0";af++}}while(false)}if(this.mant[0]==0){this.ind=this.iszero;if(this.exp>0){this.exp=0}if(ah){this.mant=this.ZERO.mant;this.exp=0}}else{if(ah){this.form=j.prototype.SCIENTIFIC;V=(this.exp+this.mant.length)-1;if((V<this.MinExp)||(V>this.MaxExp)){this.bad("BigDecimal(): ",ai)}}}return}function F(){var T;if(F.arguments.length==1){T=F.arguments[0]}else{if(F.arguments.length==0){T=this.plainMC}else{throw"abs(): "+F.arguments.length+" arguments given; expected 0 or 1"}}if(this.ind==this.isneg){return this.negate(T)}return this.plus(T)}function c(){var ac;if(c.arguments.length==2){ac=c.arguments[1]}else{if(c.arguments.length==1){ac=this.plainMC}else{throw"add(): "+c.arguments.length+" arguments given; expected 1 or 2"}}var T=c.arguments[0];var ai;var U;var ak;var W;var aj;var al;var ag;var aa=0;var V=0;var X=0;var ab=null;var ah=0;var af=0;var Z=0;var Y=0;var ae=0;var ad=0;if(ac.lostDigits){this.checkdigits(T,ac.digits)}ai=this;if(ai.ind==0){if(ac.form!=j.prototype.PLAIN){return T.plus(ac)}}if(T.ind==0){if(ac.form!=j.prototype.PLAIN){return ai.plus(ac)}}U=ac.digits;if(U>0){if(ai.mant.length>U){ai=this.clone(ai).round(ac)}if(T.mant.length>U){T=this.clone(T).round(ac)}}ak=new o();W=ai.mant;aj=ai.mant.length;al=T.mant;ag=T.mant.length;padder:do{if(ai.exp==T.exp){ak.exp=ai.exp}else{if(ai.exp>T.exp){aa=(aj+ai.exp)-T.exp;if(aa>=((ag+U)+1)){if(U>0){ak.mant=W;ak.exp=ai.exp;ak.ind=ai.ind;if(aj<U){ak.mant=this.extend(ai.mant,U);ak.exp=ak.exp-((U-aj))}return ak.finish(ac,false)}}ak.exp=T.exp;if(aa>(U+1)){if(U>0){V=(aa-U)-1;ag=ag-V;ak.exp=ak.exp+V;aa=U+1}}if(aa>aj){aj=aa}}else{aa=(ag+T.exp)-ai.exp;if(aa>=((aj+U)+1)){if(U>0){ak.mant=al;ak.exp=T.exp;ak.ind=T.ind;if(ag<U){ak.mant=this.extend(T.mant,U);ak.exp=ak.exp-((U-ag))}return ak.finish(ac,false)}}ak.exp=ai.exp;if(aa>(U+1)){if(U>0){V=(aa-U)-1;aj=aj-V;ak.exp=ak.exp+V;aa=U+1}}if(aa>ag){ag=aa}}}}while(false);if(ai.ind==this.iszero){ak.ind=this.ispos}else{ak.ind=ai.ind}if(((ai.ind==this.isneg)?1:0)==((T.ind==this.isneg)?1:0)){X=1}else{signdiff:do{X=-1;swaptest:do{if(T.ind==this.iszero){}else{if((aj<ag)||(ai.ind==this.iszero)){ab=W;W=al;al=ab;V=aj;aj=ag;ag=V;ak.ind=-ak.ind}else{if(aj>ag){}else{ah=0;af=0;Z=W.length-1;Y=al.length-1;compare:for(;;){if(ah<=Z){ae=W[ah]}else{if(af>Y){if(ac.form!=j.prototype.PLAIN){return this.ZERO}break compare}ae=0}if(af<=Y){ad=al[af]}else{ad=0}if(ae!=ad){if(ae<ad){ab=W;W=al;al=ab;V=aj;aj=ag;ag=V;ak.ind=-ak.ind}break compare}ah++;af++}}}}}while(false)}while(false)}ak.mant=this.byteaddsub(W,aj,al,ag,X,false);return ak.finish(ac,false)}function Q(){var Y;if(Q.arguments.length==2){Y=Q.arguments[1]}else{if(Q.arguments.length==1){Y=this.plainMC}else{throw"compareTo(): "+Q.arguments.length+" arguments given; expected 1 or 2"}}var X=Q.arguments[0];var W=0;var T=0;var V;if(Y.lostDigits){this.checkdigits(X,Y.digits)}if((this.ind==X.ind)&&(this.exp==X.exp)){W=this.mant.length;if(W<X.mant.length){return -this.ind}if(W>X.mant.length){return this.ind}if((W<=Y.digits)||(Y.digits==0)){var U=W;T=0;T:for(;U>0;U--,T++){if(this.mant[T]<X.mant[T]){return -this.ind}if(this.mant[T]>X.mant[T]){return this.ind}}return 0}}else{if(this.ind<X.ind){return -1}if(this.ind>X.ind){return 1}}V=this.clone(X);V.ind=-V.ind;return this.add(V,Y).ind}function v(){var V;var T=-1;if(v.arguments.length==2){if(typeof v.arguments[1]=="number"){V=new j(0,j.prototype.PLAIN,false,v.arguments[1])}else{V=v.arguments[1]}}else{if(v.arguments.length==3){T=v.arguments[1];if(T<0){throw"divide(): Negative scale: "+T}V=new j(0,j.prototype.PLAIN,false,v.arguments[2])}else{if(v.arguments.length==1){V=this.plainMC}else{throw"divide(): "+v.arguments.length+" arguments given; expected between 1 and 3"}}}var U=v.arguments[0];return this.dodivide("D",U,V,T)}function d(){var U;if(d.arguments.length==2){U=d.arguments[1]}else{if(d.arguments.length==1){U=this.plainMC}else{throw"divideInteger(): "+d.arguments.length+" arguments given; expected 1 or 2"}}var T=d.arguments[0];return this.dodivide("I",T,U,0)}function u(){var U;if(u.arguments.length==2){U=u.arguments[1]}else{if(u.arguments.length==1){U=this.plainMC}else{throw"max(): "+u.arguments.length+" arguments given; expected 1 or 2"}}var T=u.arguments[0];if((this.compareTo(T,U))>=0){return this.plus(U)}else{return T.plus(U)}}function S(){var U;if(S.arguments.length==2){U=S.arguments[1]}else{if(S.arguments.length==1){U=this.plainMC}else{throw"min(): "+S.arguments.length+" arguments given; expected 1 or 2"}}var T=S.arguments[0];if((this.compareTo(T,U))<=0){return this.plus(U)}else{return T.plus(U)}}function r(){var ae;if(r.arguments.length==2){ae=r.arguments[1]}else{if(r.arguments.length==1){ae=this.plainMC}else{throw"multiply(): "+r.arguments.length+" arguments given; expected 1 or 2"}}var aa=r.arguments[0];var W;var ad;var Z;var V=null;var af=null;var ab;var ag=0;var ac;var X;var U=0;var Y=0;if(ae.lostDigits){this.checkdigits(aa,ae.digits)}W=this;ad=0;Z=ae.digits;if(Z>0){if(W.mant.length>Z){W=this.clone(W).round(ae)}if(aa.mant.length>Z){aa=this.clone(aa).round(ae)}}else{if(W.exp>0){ad=ad+W.exp}if(aa.exp>0){ad=ad+aa.exp}}if(W.mant.length<aa.mant.length){V=W.mant;af=aa.mant}else{V=aa.mant;af=W.mant}ab=(V.length+af.length)-1;if((V[0]*af[0])>9){ag=ab+1}else{ag=ab}ac=new o();X=this.createArrayWithZeros(ag);var T=V.length;U=0;U:for(;T>0;T--,U++){Y=V[U];if(Y!=0){X=this.byteaddsub(X,X.length,af,ab,Y,true)}ab--}ac.ind=W.ind*aa.ind;ac.exp=(W.exp+aa.exp)-ad;if(ad==0){ac.mant=X}else{ac.mant=this.extend(X,X.length+ad)}return ac.finish(ae,false)}function l(){var U;if(l.arguments.length==1){U=l.arguments[0]}else{if(l.arguments.length==0){U=this.plainMC}else{throw"negate(): "+l.arguments.length+" arguments given; expected 0 or 1"}}var T;if(U.lostDigits){this.checkdigits(null,U.digits)}T=this.clone(this);T.ind=-T.ind;return T.finish(U,false)}function b(){var T;if(b.arguments.length==1){T=b.arguments[0]}else{if(b.arguments.length==0){T=this.plainMC}else{throw"plus(): "+b.arguments.length+" arguments given; expected 0 or 1"}}if(T.lostDigits){this.checkdigits(null,T.digits)}if(T.form==j.prototype.PLAIN){if(this.form==j.prototype.PLAIN){if(this.mant.length<=T.digits){return this}if(T.digits==0){return this}}}return this.clone(this).finish(T,false)}function B(){var ad;if(B.arguments.length==2){ad=B.arguments[1]}else{if(B.arguments.length==1){ad=this.plainMC}else{throw"pow(): "+B.arguments.length+" arguments given; expected 1 or 2"}}var aa=B.arguments[0];var T;var U;var W;var Z=0;var ac=0;var Y;var ab;var X;var V=0;if(ad.lostDigits){this.checkdigits(aa,ad.digits)}T=aa.intcheck(this.MinArg,this.MaxArg);U=this;W=ad.digits;if(W==0){if(aa.ind==this.isneg){throw"pow(): Negative power: "+aa.toString()}Z=0}else{if((aa.mant.length+aa.exp)>W){throw"pow(): Too many digits: "+aa.toString()}if(U.mant.length>W){U=this.clone(U).round(ad)}ac=aa.mant.length+aa.exp;Z=(W+ac)+1}Y=new j(Z,ad.form,false,ad.roundingMode);ab=this.ONE;if(T==0){return ab}if(T<0){T=-T}X=false;V=1;V:for(;;V++){T<<=1;if(T<0){X=true;ab=ab.multiply(U,Y)}if(V==31){break V}if((!X)){continue V}ab=ab.multiply(ab,Y)}if(aa.ind<0){ab=this.ONE.divide(ab,Y)}return ab.finish(ad,true)}function w(){var U;if(w.arguments.length==2){U=w.arguments[1]}else{if(w.arguments.length==1){U=this.plainMC}else{throw"remainder(): "+w.arguments.length+" arguments given; expected 1 or 2"}}var T=w.arguments[0];return this.dodivide("R",T,U,-1)}function h(){var V;if(h.arguments.length==2){V=h.arguments[1]}else{if(h.arguments.length==1){V=this.plainMC}else{throw"subtract(): "+h.arguments.length+" arguments given; expected 1 or 2"}}var U=h.arguments[0];var T;if(V.lostDigits){this.checkdigits(U,V.digits)}T=this.clone(U);T.ind=-T.ind;return this.add(T,V)}function A(X){var Z;var V=0;var Y=null;var W=null;if(X==null){return false}if((!(((X instanceof o))))){return false}Z=X;if(this.ind!=Z.ind){return false}if(((this.mant.length==Z.mant.length)&&(this.exp==Z.exp))&&(this.form==Z.form)){var U=this.mant.length;V=0;V:for(;U>0;U--,V++){if(this.mant[V]!=Z.mant[V]){return false}}}else{Y=this.layout();W=Z.layout();if(Y.length!=W.length){return false}var T=Y.length;V=0;V:for(;T>0;T--,V++){if(Y[V]!=W[V]){return false}}}return true}function E(){var ao;var Y;var V;var W;if(E.arguments.length==6){ao=E.arguments[2];Y=E.arguments[3];V=E.arguments[4];W=E.arguments[5]}else{if(E.arguments.length==2){ao=-1;Y=-1;V=j.prototype.SCIENTIFIC;W=this.ROUND_HALF_UP}else{throw"format(): "+E.arguments.length+" arguments given; expected 2 or 6"}}var ai=E.arguments[0];var X=E.arguments[1];var aa;var U=0;var Z=0;var aq=0;var T=null;var am=0;var af=0;var ad=0;var ar;var al=0;var an=null;var ap=0;var ah=0;if((ai<(-1))||(ai==0)){this.badarg("format",1,ai)}if(X<(-1)){this.badarg("format",2,X)}if((ao<(-1))||(ao==0)){this.badarg("format",3,ao)}if(Y<(-1)){this.badarg("format",4,Y)}if(V==j.prototype.SCIENTIFIC){}else{if(V==j.prototype.ENGINEERING){}else{if(V==(-1)){V=j.prototype.SCIENTIFIC}else{this.badarg("format",5,V)}}}if(W!=this.ROUND_HALF_UP){try{if(W==(-1)){W=this.ROUND_HALF_UP}else{new j(9,j.prototype.SCIENTIFIC,false,W)}}catch(ak){this.badarg("format",6,W)}}aa=this.clone(this);setform:do{if(Y==(-1)){aa.form=j.prototype.PLAIN}else{if(aa.ind==this.iszero){aa.form=j.prototype.PLAIN}else{U=aa.exp+aa.mant.length;if(U>Y){aa.form=V}else{if(U<(-5)){aa.form=V}else{aa.form=j.prototype.PLAIN}}}}}while(false);if(X>=0){setafter:for(;;){if(aa.form==j.prototype.PLAIN){Z=-aa.exp}else{if(aa.form==j.prototype.SCIENTIFIC){Z=aa.mant.length-1}else{aq=(((aa.exp+aa.mant.length)-1))%3;if(aq<0){aq=3+aq}aq++;if(aq>=aa.mant.length){Z=0}else{Z=aa.mant.length-aq}}}if(Z==X){break setafter}if(Z<X){T=this.extend(aa.mant,(aa.mant.length+X)-Z);aa.mant=T;aa.exp=aa.exp-((X-Z));if(aa.exp<this.MinExp){throw"format(): Exponent Overflow: "+aa.exp}break setafter}am=Z-X;if(am>aa.mant.length){aa.mant=this.ZERO.mant;aa.ind=this.iszero;aa.exp=0;continue setafter}af=aa.mant.length-am;ad=aa.exp;aa.round(af,W);if((aa.exp-ad)==am){break setafter}}}ar=aa.layout();if(ai>0){var aj=ar.length;al=0;al:for(;aj>0;aj--,al++){if(ar[al]=="."){break al}if(ar[al]=="E"){break al}}if(al>ai){this.badarg("format",1,ai)}if(al<ai){an=new Array((ar.length+ai)-al);var ag=ai-al;ap=0;ap:for(;ag>0;ag--,ap++){an[ap]=" "}this.arraycopy(ar,0,an,ap,ar.length);ar=an}}if(ao>0){var ae=ar.length-1;al=ar.length-1;al:for(;ae>0;ae--,al--){if(ar[al]=="E"){break al}}if(al==0){an=new Array((ar.length+ao)+2);this.arraycopy(ar,0,an,0,ar.length);var ac=ao+2;ap=ar.length;ap:for(;ac>0;ac--,ap++){an[ap]=" "}ar=an}else{ah=(ar.length-al)-2;if(ah>ao){this.badarg("format",3,ao)}if(ah<ao){an=new Array((ar.length+ao)-ah);this.arraycopy(ar,0,an,0,al+2);var ab=ao-ah;ap=al+2;ap:for(;ab>0;ab--,ap++){an[ap]="0"}this.arraycopy(ar,al+2,an,ap,ah);ar=an}}}return ar.join("")}function i(){var X;var V=0;var T;var U=0;var Y=0;if(this.ind==this.iszero){return 0}X=this.mant.length-1;if(this.exp<0){X=X+this.exp;if((!(this.allzero(this.mant,X+1)))){throw"intValueExact(): Decimal part non-zero: "+this.toString()}if(X<0){return 0}V=0}else{if((this.exp+X)>9){throw"intValueExact(): Conversion overflow: "+this.toString()}V=this.exp}T=0;var W=X+V;U=0;U:for(;U<=W;U++){T=T*10;if(U<=X){T=T+this.mant[U]}}if((X+V)==9){Y=O(T,1000000000);if(Y!=this.mant[0]){if(T==-2147483648){if(this.ind==this.isneg){if(this.mant[0]==2){return T}}}throw"intValueExact(): Conversion overflow: "+this.toString()}}if(this.ind==this.ispos){return T}return -T}function I(U){var T;T=this.clone(this);T.exp=T.exp-U;return T.finish(this.plainMC,false)}function L(U){var T;T=this.clone(this);T.exp=T.exp+U;return T.finish(this.plainMC,false)}function H(){if(this.exp>=0){return 0}return -this.exp}function x(){var U;if(x.arguments.length==2){U=x.arguments[1]}else{if(x.arguments.length==1){U=this.ROUND_UNNECESSARY}else{throw"setScale(): "+x.arguments.length+" given; expected 1 or 2"}}var Y=x.arguments[0];var T;var V;var W=0;var X=0;T=this.scale();if(T==Y){if(this.form==j.prototype.PLAIN){return this}}V=this.clone(this);if(T<=Y){if(T==0){W=V.exp+Y}else{W=Y-T}V.mant=this.extend(V.mant,V.mant.length+W);V.exp=-Y}else{if(Y<0){throw"setScale(): Negative scale: "+Y}X=V.mant.length-((T-Y));V=V.round(X,U);if(V.exp!=(-Y)){V.mant=this.extend(V.mant,V.mant.length+1);V.exp=V.exp-1}}V.form=j.prototype.PLAIN;return V}function K(){return this.ind}function e(){return this.layout().join("")}function G(){var af;var Y=0;var ae=null;var ad=0;var ag=0;var ac=0;var X=null;var ab;var Z;var aa=0;af=new Array(this.mant.length);var W=this.mant.length;Y=0;Y:for(;W>0;W--,Y++){af[Y]=this.mant[Y]+""}if(this.form!=j.prototype.PLAIN){ae="";if(this.ind==this.isneg){ae+="-"}ad=(this.exp+af.length)-1;if(this.form==j.prototype.SCIENTIFIC){ae+=af[0];if(af.length>1){ae+="."}ae+=af.slice(1).join("")}else{engineering:do{ag=ad%3;if(ag<0){ag=3+ag}ad=ad-ag;ag++;if(ag>=af.length){ae+=af.join("");var U=ag-af.length;for(;U>0;U--){ae+="0"}}else{ae+=af.slice(0,ag).join("");ae+=".";ae+=af.slice(ag).join("")}}while(false)}if(ad!=0){if(ad<0){ac="-";ad=-ad}else{ac="+"}ae+="E";ae+=ac;ae+=ad}return ae.split("")}if(this.exp==0){if(this.ind>=0){return af}X=new Array(af.length+1);X[0]="-";this.arraycopy(af,0,X,1,af.length);return X}ab=((this.ind==this.isneg)?1:0);Z=this.exp+af.length;if(Z<1){aa=(ab+2)-this.exp;X=new Array(aa);if(ab!=0){X[0]="-"}X[ab]="0";X[ab+1]=".";var V=-Z;Y=ab+2;Y:for(;V>0;V--,Y++){X[Y]="0"}this.arraycopy(af,0,X,(ab+2)-Z,af.length);return X}if(Z>af.length){aa=ab+Z;X=new Array(aa);if(ab!=0){X[0]="-"}this.arraycopy(af,0,X,ab,af.length);var T=Z-af.length;Y=ab+af.length;Y:for(;T>0;T--,Y++){X[Y]="0"}return X}aa=(ab+1)+af.length;X=new Array(aa);if(ab!=0){X[0]="-"}this.arraycopy(af,0,X,ab,Z);X[ab+Z]=".";this.arraycopy(af,Z,X,(ab+Z)+1,af.length-Z);return X}function M(V,T){var U;U=this.intValueExact();if((U<V)||(U>T)){throw"intcheck(): Conversion overflow: "+U}return U}function D(V,T,aj,au){var am;var U;var ar;var av;var ah;var aw;var Z;var at;var af;var aa;var ab;var al=0;var an=0;var Y=0;var ag=0;var ae=0;var ad=0;var ak=0;var aq=0;var ac=null;var ai=0;var X=0;var W=null;if(aj.lostDigits){this.checkdigits(T,aj.digits)}am=this;if(T.ind==0){throw"dodivide(): Divide by 0"}if(am.ind==0){if(aj.form!=j.prototype.PLAIN){return this.ZERO}if(au==(-1)){return am}return am.setScale(au)}U=aj.digits;if(U>0){if(am.mant.length>U){am=this.clone(am).round(aj)}if(T.mant.length>U){T=this.clone(T).round(aj)}}else{if(au==(-1)){au=am.scale()}U=am.mant.length;if(au!=(-am.exp)){U=(U+au)+am.exp}U=(U-((T.mant.length-1)))-T.exp;if(U<am.mant.length){U=am.mant.length}if(U<T.mant.length){U=T.mant.length}}ar=((am.exp-T.exp)+am.mant.length)-T.mant.length;if(ar<0){if(V!="D"){if(V=="I"){return this.ZERO}return this.clone(am).finish(aj,false)}}av=new o();av.ind=(am.ind*T.ind);av.exp=ar;av.mant=this.createArrayWithZeros(U+1);ah=(U+U)+1;aw=this.extend(am.mant,ah);Z=ah;at=T.mant;af=ah;aa=(at[0]*10)+1;if(at.length>1){aa=aa+at[1]}ab=0;outer:for(;;){al=0;inner:for(;;){if(Z<af){break inner}if(Z==af){compare:do{var ap=Z;an=0;an:for(;ap>0;ap--,an++){if(an<at.length){Y=at[an]}else{Y=0}if(aw[an]<Y){break inner}if(aw[an]>Y){break compare}}al++;av.mant[ab]=al;ab++;aw[0]=0;break outer}while(false);ag=aw[0]}else{ag=aw[0]*10;if(Z>1){ag=ag+aw[1]}}ae=O((ag*10),aa);if(ae==0){ae=1}al=al+ae;aw=this.byteaddsub(aw,Z,at,af,-ae,true);if(aw[0]!=0){continue inner}var ao=Z-2;ad=0;ad:for(;ad<=ao;ad++){if(aw[ad]!=0){break ad}Z--}if(ad==0){continue inner}this.arraycopy(aw,ad,aw,0,Z)}if((ab!=0)||(al!=0)){av.mant[ab]=al;ab++;if(ab==(U+1)){break outer}if(aw[0]==0){break outer}}if(au>=0){if((-av.exp)>au){break outer}}if(V!="D"){if(av.exp<=0){break outer}}av.exp=av.exp-1;af--}if(ab==0){ab=1}if((V=="I")||(V=="R")){if((ab+av.exp)>U){throw"dodivide(): Integer overflow"}if(V=="R"){w:do{if(av.mant[0]==0){return this.clone(am).finish(aj,false)}if(aw[0]==0){return this.ZERO}av.ind=am.ind;ak=((U+U)+1)-am.mant.length;av.exp=(av.exp-ak)+am.exp;aq=Z;an=aq-1;an:for(;an>=1;an--){if(!((av.exp<am.exp)&&(av.exp<T.exp))){break}if(aw[an]!=0){break an}aq--;av.exp=av.exp+1}if(aq<aw.length){ac=new Array(aq);this.arraycopy(aw,0,ac,0,aq);aw=ac}av.mant=aw;return av.finish(aj,false)}while(false)}}else{if(aw[0]!=0){ai=av.mant[ab-1];if(((ai%5))==0){av.mant[ab-1]=(ai+1)}}}if(au>=0){scaled:do{if(ab!=av.mant.length){av.exp=av.exp-((av.mant.length-ab))}X=av.mant.length-(((-av.exp)-au));av.round(X,aj.roundingMode);if(av.exp!=(-au)){av.mant=this.extend(av.mant,av.mant.length+1);av.exp=av.exp-1}return av.finish(aj,true)}while(false)}if(ab==av.mant.length){av.round(aj);ab=U}else{if(av.mant[0]==0){return this.ZERO}W=new Array(ab);this.arraycopy(av.mant,0,W,0,ab);av.mant=W}return av.finish(aj,true)}function R(U,T){throw U+"Not a number: "+T}function C(T,V,U){throw"Bad argument "+V+" to "+T+": "+U}function k(T,V){var U;if(T.length==V){return T}U=n(V);this.arraycopy(T,0,U,0,T.length);return U}function s(aj,V,ai,ag,ad,T){var ak;var ah;var ac;var al;var U;var X;var Z;var ab;var Y=0;var W=0;var aa;var ae=0;ak=aj.length;ah=ai.length;ac=V-1;al=ag-1;U=al;if(U<ac){U=ac}X=null;if(T){if((U+1)==ak){X=aj}}if(X==null){X=this.createArrayWithZeros(U+1)}Z=false;if(ad==1){Z=true}else{if(ad==(-1)){Z=true}}ab=0;Y=U;Y:for(;Y>=0;Y--){if(ac>=0){if(ac<ak){ab=ab+aj[ac]}ac--}if(al>=0){if(al<ah){if(Z){if(ad>0){ab=ab+ai[al]}else{ab=ab-ai[al]}}else{ab=ab+(ai[al]*ad)}}al--}if(ab<10){if(ab>=0){quick:do{X[Y]=ab;ab=0;continue Y}while(false)}}W=ab+90;X[Y]=this.bytedig[W];ab=this.bytecar[W]}if(ab==0){return X}aa=null;if(T){if((U+2)==aj.length){aa=aj}}if(aa==null){aa=new Array(U+2)}aa[0]=ab;var af=U+1;ae=0;ae:for(;af>0;af--,ae++){aa[ae+1]=X[ae]}return aa}function f(){var T;var V=0;var U=0;T=new Array((90+99)+1);V=0;V:for(;V<=(90+99);V++){U=V-90;if(U>=0){T[V]=(U%10);o.prototype.bytecar[V]=(O(U,10));continue V}U=U+100;T[V]=(U%10);o.prototype.bytecar[V]=((O(U,10))-10)}return T}function p(U){var T;T=new o();T.ind=U.ind;T.exp=U.exp;T.form=U.form;T.mant=U.mant;return T}function J(U,T){if(T==0){return}if(this.mant.length>T){if((!(this.allzero(this.mant,T)))){throw"Too many digits: "+this.toString()}}if(U==null){return}if(U.mant.length>T){if((!(this.allzero(U.mant,T)))){throw"Too many digits: "+U.toString()}}return}function N(){var Y;var W;if(N.arguments.length==2){Y=N.arguments[0];W=N.arguments[1]}else{if(N.arguments.length==1){var ab=N.arguments[0];Y=ab.digits;W=ab.roundingMode}else{throw"round(): "+N.arguments.length+" arguments given; expected 1 or 2"}}var ac;var U;var T;var Z=false;var V=0;var aa;var X=null;ac=this.mant.length-Y;if(ac<=0){return this}this.exp=this.exp+ac;U=this.ind;T=this.mant;if(Y>0){this.mant=new Array(Y);this.arraycopy(T,0,this.mant,0,Y);Z=true;V=T[Y]}else{this.mant=this.ZERO.mant;this.ind=this.iszero;Z=false;if(Y==0){V=T[0]}else{V=0}}aa=0;modes:do{if(W==this.ROUND_HALF_UP){if(V>=5){aa=U}}else{if(W==this.ROUND_UNNECESSARY){if((!(this.allzero(T,Y)))){throw"round(): Rounding necessary"}}else{if(W==this.ROUND_HALF_DOWN){if(V>5){aa=U}else{if(V==5){if((!(this.allzero(T,Y+1)))){aa=U}}}}else{if(W==this.ROUND_HALF_EVEN){if(V>5){aa=U}else{if(V==5){if((!(this.allzero(T,Y+1)))){aa=U}else{if((((this.mant[this.mant.length-1])%2))==1){aa=U}}}}}else{if(W==this.ROUND_DOWN){}else{if(W==this.ROUND_UP){if((!(this.allzero(T,Y)))){aa=U}}else{if(W==this.ROUND_CEILING){if(U>0){if((!(this.allzero(T,Y)))){aa=U}}}else{if(W==this.ROUND_FLOOR){if(U<0){if((!(this.allzero(T,Y)))){aa=U}}}else{throw"round(): Bad round value: "+W}}}}}}}}}while(false);if(aa!=0){bump:do{if(this.ind==this.iszero){this.mant=this.ONE.mant;this.ind=aa}else{if(this.ind==this.isneg){aa=-aa}X=this.byteaddsub(this.mant,this.mant.length,this.ONE.mant,1,aa,Z);if(X.length>this.mant.length){this.exp++;this.arraycopy(X,0,this.mant,0,this.mant.length)}else{this.mant=X}}}while(false)}if(this.exp>this.MaxExp){throw"round(): Exponent Overflow: "+this.exp}return this}function q(W,V){var U=0;if(V<0){V=0}var T=W.length-1;U=V;U:for(;U<=T;U++){if(W[U]!=0){return false}}return true}function m(aa,W){var Z=0;var U=0;var V=null;var X=0;var Y=0;if(aa.digits!=0){if(this.mant.length>aa.digits){this.round(aa)}}if(W){if(aa.form!=j.prototype.PLAIN){Z=this.mant.length;U=Z-1;U:for(;U>=1;U--){if(this.mant[U]!=0){break U}Z--;this.exp++}if(Z<this.mant.length){V=new Array(Z);this.arraycopy(this.mant,0,V,0,Z);this.mant=V}}}this.form=j.prototype.PLAIN;var T=this.mant.length;U=0;U:for(;T>0;T--,U++){if(this.mant[U]!=0){if(U>0){delead:do{V=new Array(this.mant.length-U);this.arraycopy(this.mant,U,V,0,this.mant.length-U);this.mant=V}while(false)}X=this.exp+this.mant.length;if(X>0){if(X>aa.digits){if(aa.digits!=0){this.form=aa.form}}if((X-1)<=this.MaxExp){return this}}else{if(X<(-5)){this.form=aa.form}}X--;if((X<this.MinExp)||(X>this.MaxExp)){overflow:do{if(this.form==j.prototype.ENGINEERING){Y=X%3;if(Y<0){Y=3+Y}X=X-Y;if(X>=this.MinExp){if(X<=this.MaxExp){break overflow}}}throw"finish(): Exponent Overflow: "+X}while(false)}return this}}this.ind=this.iszero;if(aa.form!=j.prototype.PLAIN){this.exp=0}else{if(this.exp>0){this.exp=0}else{if(this.exp<this.MinExp){throw"finish(): Exponent Overflow: "+this.exp}}}this.mant=this.ZERO.mant;return this}if(typeof window==="object"){window.BigDecimal=o}return o}()); \ No newline at end of file diff --git a/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/js/BigDecimal-all-1.0.3.min.js b/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/js/BigDecimal-all-1.0.3.min.js new file mode 100644 --- /dev/null +++ b/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/js/BigDecimal-all-1.0.3.min.js @@ -0,0 +1,14 @@ +/*! + * Copyright (c) 2011 Daniel Trebbien + * Portions Copyright (c) 2003 STZ-IDA and PTV AG, Karlsruhe, Germany + * Portions Copyright (c) 1995-2001 International Business Machines Corporation and others + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. + */ +;var BigDecimal=(function(){j.prototype.getDigits=y;j.prototype.getForm=g;j.prototype.getLostDigits=a;j.prototype.getRoundingMode=z;j.prototype.toString=e;j.prototype.isValidRound=P;j.prototype.PLAIN=0;j.prototype.SCIENTIFIC=1;j.prototype.ENGINEERING=2;j.prototype.ROUND_CEILING=2;j.prototype.ROUND_DOWN=1;j.prototype.ROUND_FLOOR=3;j.prototype.ROUND_HALF_DOWN=5;j.prototype.ROUND_HALF_EVEN=6;j.prototype.ROUND_HALF_UP=4;j.prototype.ROUND_UNNECESSARY=7;j.prototype.ROUND_UP=0;j.prototype.DEFAULT_FORM=j.prototype.SCIENTIFIC;j.prototype.DEFAULT_DIGITS=9;j.prototype.DEFAULT_LOSTDIGITS=false;j.prototype.DEFAULT_ROUNDINGMODE=j.prototype.ROUND_HALF_UP;j.prototype.MIN_DIGITS=0;j.prototype.MAX_DIGITS=999999999;j.prototype.ROUNDS=new Array(j.prototype.ROUND_HALF_UP,j.prototype.ROUND_UNNECESSARY,j.prototype.ROUND_CEILING,j.prototype.ROUND_DOWN,j.prototype.ROUND_FLOOR,j.prototype.ROUND_HALF_DOWN,j.prototype.ROUND_HALF_EVEN,j.prototype.ROUND_UP);j.prototype.ROUNDWORDS=new Array("ROUND_HALF_UP","ROUND_UNNECESSARY","ROUND_CEILING","ROUND_DOWN","ROUND_FLOOR","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_UP");j.prototype.DEFAULT=new j(j.prototype.DEFAULT_DIGITS,j.prototype.DEFAULT_FORM,j.prototype.DEFAULT_LOSTDIGITS,j.prototype.DEFAULT_ROUNDINGMODE);function j(){this.digits=0;this.form=0;this.lostDigits=false;this.roundingMode=0;var T=this.DEFAULT_FORM;var W=this.DEFAULT_LOSTDIGITS;var V=this.DEFAULT_ROUNDINGMODE;if(arguments.length==4){T=arguments[1];W=arguments[2];V=arguments[3]}else{if(arguments.length==3){T=arguments[1];W=arguments[2]}else{if(arguments.length==2){T=arguments[1]}else{if(arguments.length!=1){throw"MathContext(): "+arguments.length+" arguments given; expected 1 to 4"}}}}var U=arguments[0];if(U!=this.DEFAULT_DIGITS){if(U<this.MIN_DIGITS){throw"MathContext(): Digits too small: "+U}if(U>this.MAX_DIGITS){throw"MathContext(): Digits too large: "+U}}if(T==this.SCIENTIFIC){}else{if(T==this.ENGINEERING){}else{if(T==this.PLAIN){}else{throw"MathContext() Bad form value: "+T}}}if((!(this.isValidRound(V)))){throw"MathContext(): Bad roundingMode value: "+V}this.digits=U;this.form=T;this.lostDigits=W;this.roundingMode=V;return}function y(){return this.digits}function g(){return this.form}function a(){return this.lostDigits}function z(){return this.roundingMode}function e(){var W=null;var V=0;var U=null;if(this.form==this.SCIENTIFIC){W="SCIENTIFIC"}else{if(this.form==this.ENGINEERING){W="ENGINEERING"}else{W="PLAIN"}}var T=this.ROUNDS.length;V=0;V:for(;T>0;T--,V++){if(this.roundingMode==this.ROUNDS[V]){U=this.ROUNDWORDS[V];break V}}return"digits="+this.digits+" form="+W+" lostDigits="+(this.lostDigits?"1":"0")+" roundingMode="+U}function P(U){var T=0;var V=this.ROUNDS.length;T=0;T:for(;V>0;V--,T++){if(U==this.ROUNDS[T]){return true}}return false}function O(U,T){return(U-(U%T))/T}o.prototype.div=O;function t(Y,X,T,W,V){var U;if(W>X){for(U=V-1;U>=0;--U){T[U+W]=Y[U+X]}}else{for(U=0;U<V;++U){T[U+W]=Y[U+X]}}}o.prototype.arraycopy=t;function n(U){var V=new Array(U);var T;for(T=0;T<U;++T){V[T]=0}return V}o.prototype.createArrayWithZeros=n;o.prototype.abs=F;o.prototype.add=c;o.prototype.compareTo=Q;o.prototype.divide=v;o.prototype.divideInteger=d;o.prototype.max=u;o.prototype.min=S;o.prototype.multiply=r;o.prototype.negate=l;o.prototype.plus=b;o.prototype.pow=B;o.prototype.remainder=w;o.prototype.subtract=h;o.prototype.equals=A;o.prototype.format=E;o.prototype.intValueExact=i;o.prototype.movePointLeft=I;o.prototype.movePointRight=L;o.prototype.scale=H;o.prototype.setScale=x;o.prototype.signum=K;o.prototype.toString=e;o.prototype.layout=G;o.prototype.intcheck=M;o.prototype.dodivide=D;o.prototype.bad=R;o.prototype.badarg=C;o.prototype.extend=k;o.prototype.byteaddsub=s;o.prototype.diginit=f;o.prototype.clone=p;o.prototype.checkdigits=J;o.prototype.round=N;o.prototype.allzero=q;o.prototype.finish=m;o.prototype.ROUND_CEILING=j.prototype.ROUND_CEILING;o.prototype.ROUND_DOWN=j.prototype.ROUND_DOWN;o.prototype.ROUND_FLOOR=j.prototype.ROUND_FLOOR;o.prototype.ROUND_HALF_DOWN=j.prototype.ROUND_HALF_DOWN;o.prototype.ROUND_HALF_EVEN=j.prototype.ROUND_HALF_EVEN;o.prototype.ROUND_HALF_UP=j.prototype.ROUND_HALF_UP;o.prototype.ROUND_UNNECESSARY=j.prototype.ROUND_UNNECESSARY;o.prototype.ROUND_UP=j.prototype.ROUND_UP;o.prototype.ispos=1;o.prototype.iszero=0;o.prototype.isneg=-1;o.prototype.MinExp=-999999999;o.prototype.MaxExp=999999999;o.prototype.MinArg=-999999999;o.prototype.MaxArg=999999999;o.prototype.plainMC=new j(0,j.prototype.PLAIN);o.prototype.bytecar=new Array((90+99)+1);o.prototype.bytedig=f();o.prototype.ZERO=new o("0");o.prototype.ONE=new o("1");o.prototype.TEN=new o("10");function o(){this.ind=0;this.form=j.prototype.PLAIN;this.mant=null;this.exp=0;if(arguments.length==0){return}var ai;var ab;var Z;if(arguments.length==1){ai=arguments[0];ab=0;Z=ai.length}else{ai=arguments[0];ab=arguments[1];Z=arguments[2]}if(typeof ai=="string"){ai=ai.split("")}var ad;var ah;var ak;var ao;var ac;var ag=0;var an=0;var T=false;var ae=0;var aj=0;var af=0;var am=0;var al=0;var V=0;if(Z<=0){this.bad("BigDecimal(): ",ai)}this.ind=this.ispos;if(ai[0]==("-")){Z--;if(Z==0){this.bad("BigDecimal(): ",ai)}this.ind=this.isneg;ab++}else{if(ai[0]==("+")){Z--;if(Z==0){this.bad("BigDecimal(): ",ai)}ab++}}ad=false;ah=false;ak=0;ao=-1;ac=-1;var aa=Z;ag=ab;ag:for(;aa>0;aa--,ag++){an=ai[ag];if(an>="0"){if(an<="9"){ac=ag;ak++;continue ag}}if(an=="."){if(ao>=0){this.bad("BigDecimal(): ",ai)}ao=ag-ab;continue ag}if(an!="e"){if(an!="E"){if(an<"0"||an>"9"){this.bad("BigDecimal(): ",ai)}ad=true;ac=ag;ak++;continue ag}}if((ag-ab)>(Z-2)){this.bad("BigDecimal(): ",ai)}T=false;if((ai[ag+1])==("-")){T=true;ae=ag+2}else{if((ai[ag+1])==("+")){ae=ag+2}else{ae=ag+1}}aj=Z-((ae-ab));if((aj==0)||(aj>9)){this.bad("BigDecimal(): ",ai)}var Y=aj;af=ae;af:for(;Y>0;Y--,af++){am=ai[af];if(am<"0"){this.bad("BigDecimal(): ",ai)}if(am>"9"){this.bad("BigDecimal(): ",ai)}else{al=am-"0"}this.exp=(this.exp*10)+al}if(T){this.exp=-this.exp}ah=true;break ag}if(ak==0){this.bad("BigDecimal(): ",ai)}if(ao>=0){this.exp=(this.exp+ao)-ak}var X=ac-1;ag=ab;ag:for(;ag<=X;ag++){an=ai[ag];if(an=="0"){ab++;ao--;ak--}else{if(an=="."){ab++;ao--}else{if(an<="9"){break ag}else{break ag}}}}this.mant=new Array(ak);af=ab;if(ad){exotica:do{var W=ak;ag=0;ag:for(;W>0;W--,ag++){if(ag==ao){af++}am=ai[af];if(am<="9"){this.mant[ag]=am-"0"}else{this.bad("BigDecimal(): ",ai)}af++}}while(false)}else{simple:do{var U=ak;ag=0;ag:for(;U>0;U--,ag++){if(ag==ao){af++}this.mant[ag]=ai[af]-"0";af++}}while(false)}if(this.mant[0]==0){this.ind=this.iszero;if(this.exp>0){this.exp=0}if(ah){this.mant=this.ZERO.mant;this.exp=0}}else{if(ah){this.form=j.prototype.SCIENTIFIC;V=(this.exp+this.mant.length)-1;if((V<this.MinExp)||(V>this.MaxExp)){this.bad("BigDecimal(): ",ai)}}}return}function F(){var T;if(arguments.length==1){T=arguments[0]}else{if(arguments.length==0){T=this.plainMC}else{throw"abs(): "+arguments.length+" arguments given; expected 0 or 1"}}if(this.ind==this.isneg){return this.negate(T)}return this.plus(T)}function c(){var ac;if(arguments.length==2){ac=arguments[1]}else{if(arguments.length==1){ac=this.plainMC}else{throw"add(): "+arguments.length+" arguments given; expected 1 or 2"}}var T=arguments[0];var ai;var U;var ak;var W;var aj;var al;var ag;var aa=0;var V=0;var X=0;var ab=null;var ah=0;var af=0;var Z=0;var Y=0;var ae=0;var ad=0;if(ac.lostDigits){this.checkdigits(T,ac.digits)}ai=this;if(ai.ind==0){if(ac.form!=j.prototype.PLAIN){return T.plus(ac)}}if(T.ind==0){if(ac.form!=j.prototype.PLAIN){return ai.plus(ac)}}U=ac.digits;if(U>0){if(ai.mant.length>U){ai=this.clone(ai).round(ac)}if(T.mant.length>U){T=this.clone(T).round(ac)}}ak=new o();W=ai.mant;aj=ai.mant.length;al=T.mant;ag=T.mant.length;padder:do{if(ai.exp==T.exp){ak.exp=ai.exp}else{if(ai.exp>T.exp){aa=(aj+ai.exp)-T.exp;if(aa>=((ag+U)+1)){if(U>0){ak.mant=W;ak.exp=ai.exp;ak.ind=ai.ind;if(aj<U){ak.mant=this.extend(ai.mant,U);ak.exp=ak.exp-((U-aj))}return ak.finish(ac,false)}}ak.exp=T.exp;if(aa>(U+1)){if(U>0){V=(aa-U)-1;ag=ag-V;ak.exp=ak.exp+V;aa=U+1}}if(aa>aj){aj=aa}}else{aa=(ag+T.exp)-ai.exp;if(aa>=((aj+U)+1)){if(U>0){ak.mant=al;ak.exp=T.exp;ak.ind=T.ind;if(ag<U){ak.mant=this.extend(T.mant,U);ak.exp=ak.exp-((U-ag))}return ak.finish(ac,false)}}ak.exp=ai.exp;if(aa>(U+1)){if(U>0){V=(aa-U)-1;aj=aj-V;ak.exp=ak.exp+V;aa=U+1}}if(aa>ag){ag=aa}}}}while(false);if(ai.ind==this.iszero){ak.ind=this.ispos}else{ak.ind=ai.ind}if(((ai.ind==this.isneg)?1:0)==((T.ind==this.isneg)?1:0)){X=1}else{signdiff:do{X=-1;swaptest:do{if(T.ind==this.iszero){}else{if((aj<ag)||(ai.ind==this.iszero)){ab=W;W=al;al=ab;V=aj;aj=ag;ag=V;ak.ind=-ak.ind}else{if(aj>ag){}else{ah=0;af=0;Z=W.length-1;Y=al.length-1;compare:for(;;){if(ah<=Z){ae=W[ah]}else{if(af>Y){if(ac.form!=j.prototype.PLAIN){return this.ZERO}break compare}ae=0}if(af<=Y){ad=al[af]}else{ad=0}if(ae!=ad){if(ae<ad){ab=W;W=al;al=ab;V=aj;aj=ag;ag=V;ak.ind=-ak.ind}break compare}ah++;af++}}}}}while(false)}while(false)}ak.mant=this.byteaddsub(W,aj,al,ag,X,false);return ak.finish(ac,false)}function Q(){var Y;if(arguments.length==2){Y=arguments[1]}else{if(arguments.length==1){Y=this.plainMC}else{throw"compareTo(): "+arguments.length+" arguments given; expected 1 or 2"}}var X=arguments[0];var W=0;var T=0;var V;if(Y.lostDigits){this.checkdigits(X,Y.digits)}if((this.ind==X.ind)&&(this.exp==X.exp)){W=this.mant.length;if(W<X.mant.length){return -this.ind}if(W>X.mant.length){return this.ind}if((W<=Y.digits)||(Y.digits==0)){var U=W;T=0;T:for(;U>0;U--,T++){if(this.mant[T]<X.mant[T]){return -this.ind}if(this.mant[T]>X.mant[T]){return this.ind}}return 0}}else{if(this.ind<X.ind){return -1}if(this.ind>X.ind){return 1}}V=this.clone(X);V.ind=-V.ind;return this.add(V,Y).ind}function v(){var V;var T=-1;if(arguments.length==2){if(typeof arguments[1]=="number"){V=new j(0,j.prototype.PLAIN,false,arguments[1])}else{V=arguments[1]}}else{if(arguments.length==3){T=arguments[1];if(T<0){throw"divide(): Negative scale: "+T}V=new j(0,j.prototype.PLAIN,false,arguments[2])}else{if(arguments.length==1){V=this.plainMC}else{throw"divide(): "+arguments.length+" arguments given; expected between 1 and 3"}}}var U=arguments[0];return this.dodivide("D",U,V,T)}function d(){var U;if(arguments.length==2){U=arguments[1]}else{if(arguments.length==1){U=this.plainMC}else{throw"divideInteger(): "+arguments.length+" arguments given; expected 1 or 2"}}var T=arguments[0];return this.dodivide("I",T,U,0)}function u(){var U;if(arguments.length==2){U=arguments[1]}else{if(arguments.length==1){U=this.plainMC}else{throw"max(): "+arguments.length+" arguments given; expected 1 or 2"}}var T=arguments[0];if((this.compareTo(T,U))>=0){return this.plus(U)}else{return T.plus(U)}}function S(){var U;if(arguments.length==2){U=arguments[1]}else{if(arguments.length==1){U=this.plainMC}else{throw"min(): "+arguments.length+" arguments given; expected 1 or 2"}}var T=arguments[0];if((this.compareTo(T,U))<=0){return this.plus(U)}else{return T.plus(U)}}function r(){var ae;if(arguments.length==2){ae=arguments[1]}else{if(arguments.length==1){ae=this.plainMC}else{throw"multiply(): "+arguments.length+" arguments given; expected 1 or 2"}}var aa=arguments[0];var W;var ad;var Z;var V=null;var af=null;var ab;var ag=0;var ac;var X;var U=0;var Y=0;if(ae.lostDigits){this.checkdigits(aa,ae.digits)}W=this;ad=0;Z=ae.digits;if(Z>0){if(W.mant.length>Z){W=this.clone(W).round(ae)}if(aa.mant.length>Z){aa=this.clone(aa).round(ae)}}else{if(W.exp>0){ad=ad+W.exp}if(aa.exp>0){ad=ad+aa.exp}}if(W.mant.length<aa.mant.length){V=W.mant;af=aa.mant}else{V=aa.mant;af=W.mant}ab=(V.length+af.length)-1;if((V[0]*af[0])>9){ag=ab+1}else{ag=ab}ac=new o();X=this.createArrayWithZeros(ag);var T=V.length;U=0;U:for(;T>0;T--,U++){Y=V[U];if(Y!=0){X=this.byteaddsub(X,X.length,af,ab,Y,true)}ab--}ac.ind=W.ind*aa.ind;ac.exp=(W.exp+aa.exp)-ad;if(ad==0){ac.mant=X}else{ac.mant=this.extend(X,X.length+ad)}return ac.finish(ae,false)}function l(){var U;if(arguments.length==1){U=arguments[0]}else{if(arguments.length==0){U=this.plainMC}else{throw"negate(): "+arguments.length+" arguments given; expected 0 or 1"}}var T;if(U.lostDigits){this.checkdigits(null,U.digits)}T=this.clone(this);T.ind=-T.ind;return T.finish(U,false)}function b(){var T;if(arguments.length==1){T=arguments[0]}else{if(arguments.length==0){T=this.plainMC}else{throw"plus(): "+arguments.length+" arguments given; expected 0 or 1"}}if(T.lostDigits){this.checkdigits(null,T.digits)}if(T.form==j.prototype.PLAIN){if(this.form==j.prototype.PLAIN){if(this.mant.length<=T.digits){return this}if(T.digits==0){return this}}}return this.clone(this).finish(T,false)}function B(){var ad;if(arguments.length==2){ad=arguments[1]}else{if(arguments.length==1){ad=this.plainMC}else{throw"pow(): "+arguments.length+" arguments given; expected 1 or 2"}}var aa=arguments[0];var T;var U;var W;var Z=0;var ac=0;var Y;var ab;var X;var V=0;if(ad.lostDigits){this.checkdigits(aa,ad.digits)}T=aa.intcheck(this.MinArg,this.MaxArg);U=this;W=ad.digits;if(W==0){if(aa.ind==this.isneg){throw"pow(): Negative power: "+aa.toString()}Z=0}else{if((aa.mant.length+aa.exp)>W){throw"pow(): Too many digits: "+aa.toString()}if(U.mant.length>W){U=this.clone(U).round(ad)}ac=aa.mant.length+aa.exp;Z=(W+ac)+1}Y=new j(Z,ad.form,false,ad.roundingMode);ab=this.ONE;if(T==0){return ab}if(T<0){T=-T}X=false;V=1;V:for(;;V++){T<<=1;if(T<0){X=true;ab=ab.multiply(U,Y)}if(V==31){break V}if((!X)){continue V}ab=ab.multiply(ab,Y)}if(aa.ind<0){ab=this.ONE.divide(ab,Y)}return ab.finish(ad,true)}function w(){var U;if(arguments.length==2){U=arguments[1]}else{if(arguments.length==1){U=this.plainMC}else{throw"remainder(): "+arguments.length+" arguments given; expected 1 or 2"}}var T=arguments[0];return this.dodivide("R",T,U,-1)}function h(){var V;if(arguments.length==2){V=arguments[1]}else{if(arguments.length==1){V=this.plainMC}else{throw"subtract(): "+arguments.length+" arguments given; expected 1 or 2"}}var U=arguments[0];var T;if(V.lostDigits){this.checkdigits(U,V.digits)}T=this.clone(U);T.ind=-T.ind;return this.add(T,V)}function A(X){var Z;var V=0;var Y=null;var W=null;if(X==null){return false}if((!(((X instanceof o))))){return false}Z=X;if(this.ind!=Z.ind){return false}if(((this.mant.length==Z.mant.length)&&(this.exp==Z.exp))&&(this.form==Z.form)){var U=this.mant.length;V=0;V:for(;U>0;U--,V++){if(this.mant[V]!=Z.mant[V]){return false}}}else{Y=this.layout();W=Z.layout();if(Y.length!=W.length){return false}var T=Y.length;V=0;V:for(;T>0;T--,V++){if(Y[V]!=W[V]){return false}}}return true}function E(){var ao;var Y;var V;var W;if(arguments.length==6){ao=arguments[2];Y=arguments[3];V=arguments[4];W=arguments[5]}else{if(arguments.length==2){ao=-1;Y=-1;V=j.prototype.SCIENTIFIC;W=this.ROUND_HALF_UP}else{throw"format(): "+arguments.length+" arguments given; expected 2 or 6"}}var ai=arguments[0];var X=arguments[1];var aa;var U=0;var Z=0;var aq=0;var T=null;var am=0;var af=0;var ad=0;var ar;var al=0;var an=null;var ap=0;var ah=0;if((ai<(-1))||(ai==0)){this.badarg("format",1,ai)}if(X<(-1)){this.badarg("format",2,X)}if((ao<(-1))||(ao==0)){this.badarg("format",3,ao)}if(Y<(-1)){this.badarg("format",4,Y)}if(V==j.prototype.SCIENTIFIC){}else{if(V==j.prototype.ENGINEERING){}else{if(V==(-1)){V=j.prototype.SCIENTIFIC}else{this.badarg("format",5,V)}}}if(W!=this.ROUND_HALF_UP){try{if(W==(-1)){W=this.ROUND_HALF_UP}else{new j(9,j.prototype.SCIENTIFIC,false,W)}}catch(ak){this.badarg("format",6,W)}}aa=this.clone(this);setform:do{if(Y==(-1)){aa.form=j.prototype.PLAIN}else{if(aa.ind==this.iszero){aa.form=j.prototype.PLAIN}else{U=aa.exp+aa.mant.length;if(U>Y){aa.form=V}else{if(U<(-5)){aa.form=V}else{aa.form=j.prototype.PLAIN}}}}}while(false);if(X>=0){setafter:for(;;){if(aa.form==j.prototype.PLAIN){Z=-aa.exp}else{if(aa.form==j.prototype.SCIENTIFIC){Z=aa.mant.length-1}else{aq=(((aa.exp+aa.mant.length)-1))%3;if(aq<0){aq=3+aq}aq++;if(aq>=aa.mant.length){Z=0}else{Z=aa.mant.length-aq}}}if(Z==X){break setafter}if(Z<X){T=this.extend(aa.mant,(aa.mant.length+X)-Z);aa.mant=T;aa.exp=aa.exp-((X-Z));if(aa.exp<this.MinExp){throw"format(): Exponent Overflow: "+aa.exp}break setafter}am=Z-X;if(am>aa.mant.length){aa.mant=this.ZERO.mant;aa.ind=this.iszero;aa.exp=0;continue setafter}af=aa.mant.length-am;ad=aa.exp;aa.round(af,W);if((aa.exp-ad)==am){break setafter}}}ar=aa.layout();if(ai>0){var aj=ar.length;al=0;al:for(;aj>0;aj--,al++){if(ar[al]=="."){break al}if(ar[al]=="E"){break al}}if(al>ai){this.badarg("format",1,ai)}if(al<ai){an=new Array((ar.length+ai)-al);var ag=ai-al;ap=0;ap:for(;ag>0;ag--,ap++){an[ap]=" "}this.arraycopy(ar,0,an,ap,ar.length);ar=an}}if(ao>0){var ae=ar.length-1;al=ar.length-1;al:for(;ae>0;ae--,al--){if(ar[al]=="E"){break al}}if(al==0){an=new Array((ar.length+ao)+2);this.arraycopy(ar,0,an,0,ar.length);var ac=ao+2;ap=ar.length;ap:for(;ac>0;ac--,ap++){an[ap]=" "}ar=an}else{ah=(ar.length-al)-2;if(ah>ao){this.badarg("format",3,ao)}if(ah<ao){an=new Array((ar.length+ao)-ah);this.arraycopy(ar,0,an,0,al+2);var ab=ao-ah;ap=al+2;ap:for(;ab>0;ab--,ap++){an[ap]="0"}this.arraycopy(ar,al+2,an,ap,ah);ar=an}}}return ar.join("")}function i(){var X;var V=0;var T;var U=0;var Y=0;if(this.ind==this.iszero){return 0}X=this.mant.length-1;if(this.exp<0){X=X+this.exp;if((!(this.allzero(this.mant,X+1)))){throw"intValueExact(): Decimal part non-zero: "+this.toString()}if(X<0){return 0}V=0}else{if((this.exp+X)>9){throw"intValueExact(): Conversion overflow: "+this.toString()}V=this.exp}T=0;var W=X+V;U=0;U:for(;U<=W;U++){T=T*10;if(U<=X){T=T+this.mant[U]}}if((X+V)==9){Y=O(T,1000000000);if(Y!=this.mant[0]){if(T==-2147483648){if(this.ind==this.isneg){if(this.mant[0]==2){return T}}}throw"intValueExact(): Conversion overflow: "+this.toString()}}if(this.ind==this.ispos){return T}return -T}function I(U){var T;T=this.clone(this);T.exp=T.exp-U;return T.finish(this.plainMC,false)}function L(U){var T;T=this.clone(this);T.exp=T.exp+U;return T.finish(this.plainMC,false)}function H(){if(this.exp>=0){return 0}return -this.exp}function x(){var U;if(arguments.length==2){U=arguments[1]}else{if(arguments.length==1){U=this.ROUND_UNNECESSARY}else{throw"setScale(): "+arguments.length+" given; expected 1 or 2"}}var Y=arguments[0];var T;var V;var W=0;var X=0;T=this.scale();if(T==Y){if(this.form==j.prototype.PLAIN){return this}}V=this.clone(this);if(T<=Y){if(T==0){W=V.exp+Y}else{W=Y-T}V.mant=this.extend(V.mant,V.mant.length+W);V.exp=-Y}else{if(Y<0){throw"setScale(): Negative scale: "+Y}X=V.mant.length-((T-Y));V=V.round(X,U);if(V.exp!=(-Y)){V.mant=this.extend(V.mant,V.mant.length+1);V.exp=V.exp-1}}V.form=j.prototype.PLAIN;return V}function K(){return this.ind}function e(){return this.layout().join("")}function G(){var af;var Y=0;var ae=null;var ad=0;var ag=0;var ac=0;var X=null;var ab;var Z;var aa=0;af=new Array(this.mant.length);var W=this.mant.length;Y=0;Y:for(;W>0;W--,Y++){af[Y]=this.mant[Y]+""}if(this.form!=j.prototype.PLAIN){ae="";if(this.ind==this.isneg){ae+="-"}ad=(this.exp+af.length)-1;if(this.form==j.prototype.SCIENTIFIC){ae+=af[0];if(af.length>1){ae+="."}ae+=af.slice(1).join("")}else{engineering:do{ag=ad%3;if(ag<0){ag=3+ag}ad=ad-ag;ag++;if(ag>=af.length){ae+=af.join("");var U=ag-af.length;for(;U>0;U--){ae+="0"}}else{ae+=af.slice(0,ag).join("");ae+=".";ae+=af.slice(ag).join("")}}while(false)}if(ad!=0){if(ad<0){ac="-";ad=-ad}else{ac="+"}ae+="E";ae+=ac;ae+=ad}return ae.split("")}if(this.exp==0){if(this.ind>=0){return af}X=new Array(af.length+1);X[0]="-";this.arraycopy(af,0,X,1,af.length);return X}ab=((this.ind==this.isneg)?1:0);Z=this.exp+af.length;if(Z<1){aa=(ab+2)-this.exp;X=new Array(aa);if(ab!=0){X[0]="-"}X[ab]="0";X[ab+1]=".";var V=-Z;Y=ab+2;Y:for(;V>0;V--,Y++){X[Y]="0"}this.arraycopy(af,0,X,(ab+2)-Z,af.length);return X}if(Z>af.length){aa=ab+Z;X=new Array(aa);if(ab!=0){X[0]="-"}this.arraycopy(af,0,X,ab,af.length);var T=Z-af.length;Y=ab+af.length;Y:for(;T>0;T--,Y++){X[Y]="0"}return X}aa=(ab+1)+af.length;X=new Array(aa);if(ab!=0){X[0]="-"}this.arraycopy(af,0,X,ab,Z);X[ab+Z]=".";this.arraycopy(af,Z,X,(ab+Z)+1,af.length-Z);return X}function M(V,T){var U;U=this.intValueExact();if((U<V)||(U>T)){throw"intcheck(): Conversion overflow: "+U}return U}function D(V,T,aj,au){var am;var U;var ar;var av;var ah;var aw;var Z;var at;var af;var aa;var ab;var al=0;var an=0;var Y=0;var ag=0;var ae=0;var ad=0;var ak=0;var aq=0;var ac=null;var ai=0;var X=0;var W=null;if(aj.lostDigits){this.checkdigits(T,aj.digits)}am=this;if(T.ind==0){throw"dodivide(): Divide by 0"}if(am.ind==0){if(aj.form!=j.prototype.PLAIN){return this.ZERO}if(au==(-1)){return am}return am.setScale(au)}U=aj.digits;if(U>0){if(am.mant.length>U){am=this.clone(am).round(aj)}if(T.mant.length>U){T=this.clone(T).round(aj)}}else{if(au==(-1)){au=am.scale()}U=am.mant.length;if(au!=(-am.exp)){U=(U+au)+am.exp}U=(U-((T.mant.length-1)))-T.exp;if(U<am.mant.length){U=am.mant.length}if(U<T.mant.length){U=T.mant.length}}ar=((am.exp-T.exp)+am.mant.length)-T.mant.length;if(ar<0){if(V!="D"){if(V=="I"){return this.ZERO}return this.clone(am).finish(aj,false)}}av=new o();av.ind=(am.ind*T.ind);av.exp=ar;av.mant=this.createArrayWithZeros(U+1);ah=(U+U)+1;aw=this.extend(am.mant,ah);Z=ah;at=T.mant;af=ah;aa=(at[0]*10)+1;if(at.length>1){aa=aa+at[1]}ab=0;outer:for(;;){al=0;inner:for(;;){if(Z<af){break inner}if(Z==af){compare:do{var ap=Z;an=0;an:for(;ap>0;ap--,an++){if(an<at.length){Y=at[an]}else{Y=0}if(aw[an]<Y){break inner}if(aw[an]>Y){break compare}}al++;av.mant[ab]=al;ab++;aw[0]=0;break outer}while(false);ag=aw[0]}else{ag=aw[0]*10;if(Z>1){ag=ag+aw[1]}}ae=O((ag*10),aa);if(ae==0){ae=1}al=al+ae;aw=this.byteaddsub(aw,Z,at,af,-ae,true);if(aw[0]!=0){continue inner}var ao=Z-2;ad=0;ad:for(;ad<=ao;ad++){if(aw[ad]!=0){break ad}Z--}if(ad==0){continue inner}this.arraycopy(aw,ad,aw,0,Z)}if((ab!=0)||(al!=0)){av.mant[ab]=al;ab++;if(ab==(U+1)){break outer}if(aw[0]==0){break outer}}if(au>=0){if((-av.exp)>au){break outer}}if(V!="D"){if(av.exp<=0){break outer}}av.exp=av.exp-1;af--}if(ab==0){ab=1}if((V=="I")||(V=="R")){if((ab+av.exp)>U){throw"dodivide(): Integer overflow"}if(V=="R"){w:do{if(av.mant[0]==0){return this.clone(am).finish(aj,false)}if(aw[0]==0){return this.ZERO}av.ind=am.ind;ak=((U+U)+1)-am.mant.length;av.exp=(av.exp-ak)+am.exp;aq=Z;an=aq-1;an:for(;an>=1;an--){if(!((av.exp<am.exp)&&(av.exp<T.exp))){break}if(aw[an]!=0){break an}aq--;av.exp=av.exp+1}if(aq<aw.length){ac=new Array(aq);this.arraycopy(aw,0,ac,0,aq);aw=ac}av.mant=aw;return av.finish(aj,false)}while(false)}}else{if(aw[0]!=0){ai=av.mant[ab-1];if(((ai%5))==0){av.mant[ab-1]=(ai+1)}}}if(au>=0){scaled:do{if(ab!=av.mant.length){av.exp=av.exp-((av.mant.length-ab))}X=av.mant.length-(((-av.exp)-au));av.round(X,aj.roundingMode);if(av.exp!=(-au)){av.mant=this.extend(av.mant,av.mant.length+1);av.exp=av.exp-1}return av.finish(aj,true)}while(false)}if(ab==av.mant.length){av.round(aj);ab=U}else{if(av.mant[0]==0){return this.ZERO}W=new Array(ab);this.arraycopy(av.mant,0,W,0,ab);av.mant=W}return av.finish(aj,true)}function R(U,T){throw U+"Not a number: "+T}function C(T,V,U){throw"Bad argument "+V+" to "+T+": "+U}function k(T,V){var U;if(T.length==V){return T}U=n(V);this.arraycopy(T,0,U,0,T.length);return U}function s(aj,V,ai,ag,ad,T){var ak;var ah;var ac;var al;var U;var X;var Z;var ab;var Y=0;var W=0;var aa;var ae=0;ak=aj.length;ah=ai.length;ac=V-1;al=ag-1;U=al;if(U<ac){U=ac}X=null;if(T){if((U+1)==ak){X=aj}}if(X==null){X=this.createArrayWithZeros(U+1)}Z=false;if(ad==1){Z=true}else{if(ad==(-1)){Z=true}}ab=0;Y=U;Y:for(;Y>=0;Y--){if(ac>=0){if(ac<ak){ab=ab+aj[ac]}ac--}if(al>=0){if(al<ah){if(Z){if(ad>0){ab=ab+ai[al]}else{ab=ab-ai[al]}}else{ab=ab+(ai[al]*ad)}}al--}if(ab<10){if(ab>=0){quick:do{X[Y]=ab;ab=0;continue Y}while(false)}}W=ab+90;X[Y]=this.bytedig[W];ab=this.bytecar[W]}if(ab==0){return X}aa=null;if(T){if((U+2)==aj.length){aa=aj}}if(aa==null){aa=new Array(U+2)}aa[0]=ab;var af=U+1;ae=0;ae:for(;af>0;af--,ae++){aa[ae+1]=X[ae]}return aa}function f(){var T;var V=0;var U=0;T=new Array((90+99)+1);V=0;V:for(;V<=(90+99);V++){U=V-90;if(U>=0){T[V]=(U%10);o.prototype.bytecar[V]=(O(U,10));continue V}U=U+100;T[V]=(U%10);o.prototype.bytecar[V]=((O(U,10))-10)}return T}function p(U){var T;T=new o();T.ind=U.ind;T.exp=U.exp;T.form=U.form;T.mant=U.mant;return T}function J(U,T){if(T==0){return}if(this.mant.length>T){if((!(this.allzero(this.mant,T)))){throw"Too many digits: "+this.toString()}}if(U==null){return}if(U.mant.length>T){if((!(this.allzero(U.mant,T)))){throw"Too many digits: "+U.toString()}}return}function N(){var Y;var W;if(arguments.length==2){Y=arguments[0];W=arguments[1]}else{if(arguments.length==1){var ab=arguments[0];Y=ab.digits;W=ab.roundingMode}else{throw"round(): "+arguments.length+" arguments given; expected 1 or 2"}}var ac;var U;var T;var Z=false;var V=0;var aa;var X=null;ac=this.mant.length-Y;if(ac<=0){return this}this.exp=this.exp+ac;U=this.ind;T=this.mant;if(Y>0){this.mant=new Array(Y);this.arraycopy(T,0,this.mant,0,Y);Z=true;V=T[Y]}else{this.mant=this.ZERO.mant;this.ind=this.iszero;Z=false;if(Y==0){V=T[0]}else{V=0}}aa=0;modes:do{if(W==this.ROUND_HALF_UP){if(V>=5){aa=U}}else{if(W==this.ROUND_UNNECESSARY){if((!(this.allzero(T,Y)))){throw"round(): Rounding necessary"}}else{if(W==this.ROUND_HALF_DOWN){if(V>5){aa=U}else{if(V==5){if((!(this.allzero(T,Y+1)))){aa=U}}}}else{if(W==this.ROUND_HALF_EVEN){if(V>5){aa=U}else{if(V==5){if((!(this.allzero(T,Y+1)))){aa=U}else{if((((this.mant[this.mant.length-1])%2))==1){aa=U}}}}}else{if(W==this.ROUND_DOWN){}else{if(W==this.ROUND_UP){if((!(this.allzero(T,Y)))){aa=U}}else{if(W==this.ROUND_CEILING){if(U>0){if((!(this.allzero(T,Y)))){aa=U}}}else{if(W==this.ROUND_FLOOR){if(U<0){if((!(this.allzero(T,Y)))){aa=U}}}else{throw"round(): Bad round value: "+W}}}}}}}}}while(false);if(aa!=0){bump:do{if(this.ind==this.iszero){this.mant=this.ONE.mant;this.ind=aa}else{if(this.ind==this.isneg){aa=-aa}X=this.byteaddsub(this.mant,this.mant.length,this.ONE.mant,1,aa,Z);if(X.length>this.mant.length){this.exp++;this.arraycopy(X,0,this.mant,0,this.mant.length)}else{this.mant=X}}}while(false)}if(this.exp>this.MaxExp){throw"round(): Exponent Overflow: "+this.exp}return this}function q(W,V){var U=0;if(V<0){V=0}var T=W.length-1;U=V;U:for(;U<=T;U++){if(W[U]!=0){return false}}return true}function m(aa,W){var Z=0;var U=0;var V=null;var X=0;var Y=0;if(aa.digits!=0){if(this.mant.length>aa.digits){this.round(aa)}}if(W){if(aa.form!=j.prototype.PLAIN){Z=this.mant.length;U=Z-1;U:for(;U>=1;U--){if(this.mant[U]!=0){break U}Z--;this.exp++}if(Z<this.mant.length){V=new Array(Z);this.arraycopy(this.mant,0,V,0,Z);this.mant=V}}}this.form=j.prototype.PLAIN;var T=this.mant.length;U=0;U:for(;T>0;T--,U++){if(this.mant[U]!=0){if(U>0){delead:do{V=new Array(this.mant.length-U);this.arraycopy(this.mant,U,V,0,this.mant.length-U);this.mant=V}while(false)}X=this.exp+this.mant.length;if(X>0){if(X>aa.digits){if(aa.digits!=0){this.form=aa.form}}if((X-1)<=this.MaxExp){return this}}else{if(X<(-5)){this.form=aa.form}}X--;if((X<this.MinExp)||(X>this.MaxExp)){overflow:do{if(this.form==j.prototype.ENGINEERING){Y=X%3;if(Y<0){Y=3+Y}X=X-Y;if(X>=this.MinExp){if(X<=this.MaxExp){break overflow}}}throw"finish(): Exponent Overflow: "+X}while(false)}return this}}this.ind=this.iszero;if(aa.form!=j.prototype.PLAIN){this.exp=0}else{if(this.exp>0){this.exp=0}else{if(this.exp<this.MinExp){throw"finish(): Exponent Overflow: "+this.exp}}}this.mant=this.ZERO.mant;return this}if(typeof window==="object"){window.BigDecimal=o}return o}()); \ No newline at end of file diff --git a/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/ui-test-suite/index.html b/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/ui-test-suite/index.html --- a/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/ui-test-suite/index.html +++ b/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/ui-test-suite/index.html @@ -27,7 +27,7 @@ <script type="text/javascript" src="../js/LAB.min.js"></script> <script type="text/javascript" src="./qunit/qunit.js"></script> -<script src="../js/BigDecimal-all-1.0.1.min.js"></script> +<script src="../js/BigDecimal-all-1.0.3.min.js"></script> <title>Openbravo - Test Suite</title> </head> diff --git a/src/index.jsp b/src/index.jsp --- a/src/index.jsp +++ b/src/index.jsp @@ -155,7 +155,7 @@ } %> <script src="./web/org.openbravo.client.kernel/js/LAB.min.js"></script> -<script src="./web/org.openbravo.client.kernel/js/BigDecimal-all-1.0.1.min.js"></script> +<script src="./web/org.openbravo.client.kernel/js/BigDecimal-all-1.0.3.min.js"></script> <script> (function () { ![]() | |||||||
![]() |
|
![]() |
|
(0113616) hgbot (developer) 2019-07-24 13:40 |
Repository: erp/devel/pi Changeset: 749257ab2004156a6670b6f82e1eddd35873cb6b Author: Asier Lostalé <asier.lostale <at> openbravo.com> Date: Mon Jul 08 14:09:33 2019 +0200 URL: http://code.openbravo.com/erp/devel/pi/rev/749257ab2004156a6670b6f82e1eddd35873cb6b [^] fixed issue 41073: BigDecimal.js uses deprecated Function.arguments Updated BidDecimal.js library from version 1.0.2 to 1.0.3 which is a fork of original one that can be found at https://github.com/alostale/BigDecimal.js. [^] --- M legal/Licensing.txt M modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/ui-test-suite/index.html M src/index.jsp A modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/js/BigDecimal-all-1.0.3.js A modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/js/BigDecimal-all-1.0.3.min.js R modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/js/BigDecimal-all-1.0.1.min.js --- |
(0113617) hgbot (developer) 2019-07-24 13:41 |
Repository: erp/pmods/org.openbravo.mobile.core Changeset: ce9737beff16ea550c51270c86ef15d974b4b1d3 Author: Asier Lostalé <asier.lostale <at> openbravo.com> Date: Mon Jul 08 14:11:34 2019 +0200 URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/ce9737beff16ea550c51270c86ef15d974b4b1d3 [^] fixed bug 41073: BigDecimal.js uses deprecated Function.arguments Removed copy of that library in mobile.core to use the one in client.kernel which has been updated to fix the problem. --- M legal/Licensing.txt M src/org/openbravo/mobile/core/LibraryResource.java R legal/icu4j_license.txt R web/org.openbravo.mobile.core/lib/vendor/bigdecimal-1.0.1.js R web/org.openbravo.mobile.core/lib/vendor/bigdecimal-1.0.1.min.js --- |
(0113653) caristu (viewer) 2019-07-26 08:15 |
Reviewed + tested OK. |
(0114174) hudsonbot (viewer) 2019-08-22 14:45 |
A changeset related to this issue has been promoted main and to the Central Repository, after passing a series of tests. Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/ad3efd3bd07c [^] Maturity status: Test |
![]() |
|||
Date Modified | Username | Field | Change |
2019-06-12 08:35 | alostale | New Issue | |
2019-06-12 08:35 | alostale | Assigned To | => platform |
2019-06-12 08:35 | alostale | OBNetwork customer | => No |
2019-06-12 08:35 | alostale | Modules | => Core |
2019-06-12 08:35 | alostale | Triggers an Emergency Pack | => No |
2019-06-12 08:36 | alostale | Status | new => acknowledged |
2019-06-12 08:39 | alostale | Proposed Solution updated | |
2019-06-12 16:36 | alostale | Proposed Solution updated | |
2019-07-05 11:00 | caristu | File Added: 41073_core.diff | |
2019-07-05 11:10 | caristu | File Added: 41073_mobilecore.diff | |
2019-07-24 13:40 | hgbot | Checkin | |
2019-07-24 13:40 | hgbot | Note Added: 0113616 | |
2019-07-24 13:40 | hgbot | Status | acknowledged => resolved |
2019-07-24 13:40 | hgbot | Resolution | open => fixed |
2019-07-24 13:40 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/749257ab2004156a6670b6f82e1eddd35873cb6b [^] |
2019-07-24 13:41 | alostale | Review Assigned To | => caristu |
2019-07-24 13:41 | hgbot | Checkin | |
2019-07-24 13:41 | hgbot | Note Added: 0113617 | |
2019-07-24 13:41 | hgbot | Fixed in SCM revision | http://code.openbravo.com/erp/devel/pi/rev/749257ab2004156a6670b6f82e1eddd35873cb6b [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/ce9737beff16ea550c51270c86ef15d974b4b1d3 [^] |
2019-07-26 08:15 | caristu | Assigned To | platform => alostale |
2019-07-26 08:15 | caristu | Note Added: 0113653 | |
2019-07-26 08:15 | caristu | Status | resolved => closed |
2019-07-26 08:16 | caristu | Fixed in Version | => 3.0PR19Q4 |
2019-08-22 14:45 | hudsonbot | Checkin | |
2019-08-22 14:45 | hudsonbot | Note Added: 0114174 |
Copyright © 2000 - 2009 MantisBT Group |