| @@ 2095-2115 (lines=21) @@ | ||
| 2092 | yc = ( id = 17, y = new BigNumber( y, b ) ).c; |
|
| 2093 | ||
| 2094 | // Either NaN, ±Infinity or ±0? |
|
| 2095 | if ( !xc || !yc || !xc[0] || !yc[0] ) { |
|
| 2096 | ||
| 2097 | // Return NaN if either is NaN, or one is 0 and the other is Infinity. |
|
| 2098 | if ( !x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc ) { |
|
| 2099 | y.c = y.e = y.s = null; |
|
| 2100 | } else { |
|
| 2101 | y.s *= x.s; |
|
| 2102 | ||
| 2103 | // Return ±Infinity if either is ±Infinity. |
|
| 2104 | if ( !xc || !yc ) { |
|
| 2105 | y.c = y.e = null; |
|
| 2106 | ||
| 2107 | // Return ±0 if either is ±0. |
|
| 2108 | } else { |
|
| 2109 | y.c = [0]; |
|
| 2110 | y.e = 0; |
|
| 2111 | } |
|
| 2112 | } |
|
| 2113 | ||
| 2114 | return y; |
|
| 2115 | } |
|
| 2116 | ||
| 2117 | e = bitFloor( x.e / LOG_BASE ) + bitFloor( y.e / LOG_BASE ); |
|
| 2118 | y.s *= x.s; |
|
| @@ 815-825 (lines=11) @@ | ||
| 812 | yc = y.c; |
|
| 813 | ||
| 814 | // Either NaN, Infinity or 0? |
|
| 815 | if ( !xc || !xc[0] || !yc || !yc[0] ) { |
|
| 816 | ||
| 817 | return new BigNumber( |
|
| 818 | ||
| 819 | // Return NaN if either NaN, or both Infinity or 0. |
|
| 820 | !x.s || !y.s || ( xc ? yc && xc[0] == yc[0] : !yc ) ? NaN : |
|
| 821 | ||
| 822 | // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. |
|
| 823 | xc && xc[0] == 0 || !yc ? s * 0 : s / 0 |
|
| 824 | ); |
|
| 825 | } |
|
| 826 | ||
| 827 | q = new BigNumber(s); |
|
| 828 | qc = q.c = []; |
|