File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -147,28 +147,28 @@ static public Number remainder(Number x, Number y){
147147 return ops (x ).combine (yops ).remainder (x , y );
148148}
149149
150- static Number quotient (double n , double d ){
150+ static double quotient (double n , double d ){
151151 double q = n / d ;
152152 if (q <= Long .MAX_VALUE && q >= Long .MIN_VALUE )
153153 {
154- return box ( (long ) q ) ;
154+ return ( double ) (long ) q ;
155155 }
156156 else
157157 { //bigint quotient
158- return new BigDecimal (q ).toBigInteger ();
158+ return new BigDecimal (q ).toBigInteger (). doubleValue () ;
159159 }
160160}
161161
162- static Number remainder (double n , double d ){
162+ static double remainder (double n , double d ){
163163 double q = n / d ;
164164 if (q <= Long .MAX_VALUE && q >= Long .MIN_VALUE )
165165 {
166- return Double . valueOf (( n - ((int ) q ) * d ) );
166+ return ( n - ((long ) q ) * d );
167167 }
168168 else
169169 { //bigint quotient
170170 Number bq = new BigDecimal (q ).toBigInteger ();
171- return Double . valueOf (( n - bq .doubleValue () * d ) );
171+ return ( n - bq .doubleValue () * d );
172172 }
173173}
174174
You can’t perform that action at this time.
0 commit comments