OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 // |
| 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions |
| 6 // are met: |
| 7 // 1. Redistributions of source code must retain the above copyright |
| 8 // notice, this list of conditions and the following disclaimer. |
| 9 // 2. Redistributions in binary form must reproduce the above copyright |
| 10 // notice, this list of conditions and the following disclaimer in the |
| 11 // documentation and/or other materials provided with the distribution. |
| 12 // |
| 13 // THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y |
| 14 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 15 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 16 // DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y |
| 17 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 18 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 19 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N |
| 20 // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 21 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 22 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 |
| 24 description("KDE JS Test"); |
| 25 shouldBe("Number()", "0"); |
| 26 shouldBe("Number(1)", "1"); |
| 27 shouldBe("Number(1.1)", "1.1"); |
| 28 shouldBe("Number('1.2')", "1.2"); |
| 29 shouldBe("isNaN(Number('a'))", "true"); |
| 30 |
| 31 shouldBe("(new Number()).valueOf()", "0"); |
| 32 shouldBe("(new Number(.4)).valueOf()", "0.4"); |
| 33 shouldBe("(new Number('1.')).valueOf()", "1"); |
| 34 shouldBe("isNaN(new Number('a'))", "true"); |
| 35 |
| 36 shouldBe("isNaN(Number.NaN)", "true"); |
| 37 shouldBe("Number.NEGATIVE_INFINITY", "-Infinity"); |
| 38 shouldBe("Number.POSITIVE_INFINITY", "Infinity"); |
| 39 |
| 40 shouldBe("(1).toString()", "'1'"); |
| 41 shouldBe("typeof (1).toString()", "'string'"); |
| 42 shouldBe("(10).toString(16)", "'a'"); |
| 43 shouldBe("(8.5).toString(16)", "'8.8'"); |
| 44 shouldBe("(-8.5).toString(16)", "'-8.8'"); |
| 45 shouldBe("Number.NaN.toString(16)", "'NaN'"); |
| 46 shouldBe("Number.POSITIVE_INFINITY.toString(16)", "'Infinity'"); |
| 47 shouldBe("Number.NEGATIVE_INFINITY.toString(16)", "'-Infinity'"); |
| 48 shouldBe("Number.MAX_VALUE.toString(2).length", "1024"); |
| 49 shouldBe("(1).valueOf()", "1"); |
| 50 shouldBe("typeof (1).valueOf()", "'number'"); |
| 51 |
| 52 function toFixedOrException(val,fractionDigits) |
| 53 { |
| 54 var s = ""; |
| 55 try { |
| 56 s = String(Number(val).toFixed(fractionDigits)); |
| 57 } |
| 58 catch (e) { |
| 59 s = String(e); |
| 60 } |
| 61 return s; |
| 62 } |
| 63 |
| 64 shouldBe("Number(1234.567).toFixed(0)","\"1235\""); |
| 65 shouldBe("Number(1234.567).toFixed(undefined)","\"1235\""); |
| 66 shouldBe("Number(-1234.567).toFixed(0)","\"-1235\""); |
| 67 shouldBe("Number(-1234.567).toFixed(undefined)","\"-1235\""); |
| 68 shouldBe("Number(0).toFixed(7)","\"0.0000000\""); |
| 69 shouldBe("Number(0.003).toFixed(0)","\"0\""); |
| 70 shouldBe("Number(-0.003).toFixed(0)","\"-0\""); |
| 71 shouldBe("Number(40.1234567890123).toFixed(7)","\"40.1234568\""); |
| 72 shouldBe("Number(-40.1234567890123).toFixed(7)","\"-40.1234568\""); |
| 73 shouldBe("Number(4).toFixed(7)","\"4.0000000\""); |
| 74 shouldBe("Number(-4).toFixed(7)","\"-4.0000000\""); |
| 75 shouldBe("Number(0.000056).toFixed(7)","\"0.0000560\""); |
| 76 shouldBe("Number(-0.000056).toFixed(7)","\"-0.0000560\""); |
| 77 shouldBe("Number(NaN).toFixed(7)","\"NaN\""); |
| 78 shouldBe("Number(Infinity).toFixed(7)","\"Infinity\""); |
| 79 shouldBe("Number(-Infinity).toFixed(7)","\"-Infinity\""); |
| 80 shouldBe("Number(Math.pow(10,4)).toFixed(13)","\"10000.0000000000000\""); |
| 81 shouldBe("Number(Math.pow(10,17)).toFixed(16)","\"100000000000000000.00000000000
00000\""); |
| 82 shouldBe("Number(Math.pow(10,18)).toFixed(17)","\"1000000000000000000.0000000000
0000000\""); |
| 83 shouldBe("Number(Math.pow(10,19)).toFixed(18)","\"10000000000000000000.000000000
000000000\""); |
| 84 shouldBe("Number(Math.pow(10,17)).toFixed(20)","\"100000000000000000.00000000000
000000000\""); |
| 85 shouldBe("Number(Math.pow(10,18)).toFixed(20)","\"1000000000000000000.0000000000
0000000000\""); |
| 86 shouldBe("Number(Math.pow(10,19)).toFixed(20)","\"10000000000000000000.000000000
00000000000\""); |
| 87 shouldBe("Number(Math.pow(10,20)).toFixed(20)","\"100000000000000000000.00000000
000000000000\""); |
| 88 shouldBe("Number(Math.pow(10,21)).toFixed(20)","\"1e+21\""); |
| 89 shouldBe("Number(-Math.pow(10,4)).toFixed(13)","\"-10000.0000000000000\""); |
| 90 shouldBe("Number(-Math.pow(10,17)).toFixed(16)","\"-100000000000000000.000000000
0000000\""); |
| 91 shouldBe("Number(-Math.pow(10,18)).toFixed(17)","\"-1000000000000000000.00000000
000000000\""); |
| 92 shouldBe("Number(-Math.pow(10,19)).toFixed(18)","\"-10000000000000000000.0000000
00000000000\""); |
| 93 shouldBe("Number(-Math.pow(10,17)).toFixed(20)","\"-100000000000000000.000000000
00000000000\""); |
| 94 shouldBe("Number(-Math.pow(10,18)).toFixed(20)","\"-1000000000000000000.00000000
000000000000\""); |
| 95 shouldBe("Number(-Math.pow(10,19)).toFixed(20)","\"-10000000000000000000.0000000
0000000000000\""); |
| 96 shouldBe("Number(-Math.pow(10,20)).toFixed(20)","\"-100000000000000000000.000000
00000000000000\""); |
| 97 shouldBe("Number(-Math.pow(10,21)).toFixed(20)","\"-1e+21\""); |
| 98 shouldBeTrue("toFixedOrException(2,-1).indexOf('Range') >= 0"); |
| 99 shouldBe("Number(2).toFixed(0)","\"2\""); |
| 100 shouldBe("Number(2).toFixed(20)","\"2.00000000000000000000\""); |
| 101 shouldBeTrue("toFixedOrException(2,21).indexOf('Range') >= 0"); |
| 102 shouldBeTrue("toFixedOrException(-2,-1).indexOf('Range') >= 0"); |
| 103 shouldBe("Number(-2).toFixed(0)","\"-2\""); |
| 104 shouldBe("Number(-2).toFixed(20)","\"-2.00000000000000000000\""); |
| 105 shouldBeTrue("toFixedOrException(-2,21).indexOf('Range') >= 0"); |
| 106 |
| 107 |
| 108 |
| 109 |
| 110 shouldBe("Number(NaN).toExponential()","\"NaN\""); |
| 111 shouldBe("Number(Infinity).toExponential()","\"Infinity\""); |
| 112 shouldBe("Number(-Infinity).toExponential()","\"-Infinity\""); |
| 113 shouldBe("Number(NaN).toExponential(4)","\"NaN\""); |
| 114 shouldBe("Number(Infinity).toExponential(4)","\"Infinity\""); |
| 115 shouldBe("Number(-Infinity).toExponential(4)","\"-Infinity\""); |
| 116 shouldBe("Number(123.456).toExponential()","\"1.23456e+2\""); |
| 117 shouldBeTrue("try { Number(123.456).toExponential(-1) } catch (e) { String(e).in
dexOf('Range') >= 0; }"); |
| 118 shouldBe("Number(123.456).toExponential(0)","\"1e+2\""); |
| 119 shouldBe("Number(123.456).toExponential(1)","\"1.2e+2\""); |
| 120 shouldBe("Number(123.456).toExponential(2)","\"1.23e+2\""); |
| 121 shouldBe("Number(123.456).toExponential(3)","\"1.235e+2\""); |
| 122 shouldBe("Number(123.456).toExponential(4)","\"1.2346e+2\""); |
| 123 shouldBe("Number(123.456).toExponential(5)","\"1.23456e+2\""); |
| 124 shouldBe("Number(123.456).toExponential(6)","\"1.234560e+2\""); |
| 125 shouldBe("Number(123.456).toExponential(7)","\"1.2345600e+2\""); |
| 126 shouldBe("Number(123.456).toExponential(8)","\"1.23456000e+2\""); |
| 127 shouldBe("Number(123.456).toExponential(9)","\"1.234560000e+2\""); |
| 128 shouldBe("Number(123.456).toExponential(10)","\"1.2345600000e+2\""); |
| 129 shouldBe("Number(123.456).toExponential(11)","\"1.23456000000e+2\""); |
| 130 shouldBe("Number(123.456).toExponential(12)","\"1.234560000000e+2\""); |
| 131 shouldBe("Number(123.456).toExponential(13)","\"1.2345600000000e+2\""); |
| 132 shouldBe("Number(123.456).toExponential(14)","\"1.23456000000000e+2\""); |
| 133 shouldBe("Number(123.456).toExponential(15)","\"1.234560000000000e+2\""); |
| 134 shouldBe("Number(123.456).toExponential(16)","\"1.2345600000000000e+2\""); |
| 135 shouldBe("Number(123.456).toExponential(17)","\"1.23456000000000003e+2\""); |
| 136 shouldBe("Number(123.456).toExponential(18)","\"1.234560000000000031e+2\""); |
| 137 shouldBe("Number(123.456).toExponential(19)","\"1.2345600000000000307e+2\""); |
| 138 shouldBe("Number(123.456).toExponential(20)","\"1.23456000000000003070e+2\""); |
| 139 shouldBeTrue("try { Number(123.456).toExponential(21) } catch (e) { String(e).in
dexOf('Range') >= 0; }"); |
| 140 shouldBe("Number(-123.456).toExponential()","\"-1.23456e+2\""); |
| 141 shouldBeTrue("try { Number(-123.456).toExponential(-1) } catch (e) { String(e).i
ndexOf('Range') >= 0; }"); |
| 142 shouldBe("Number(-123.456).toExponential(0)","\"-1e+2\""); |
| 143 shouldBe("Number(-123.456).toExponential(1)","\"-1.2e+2\""); |
| 144 shouldBe("Number(-123.456).toExponential(2)","\"-1.23e+2\""); |
| 145 shouldBe("Number(-123.456).toExponential(3)","\"-1.235e+2\""); |
| 146 shouldBe("Number(-123.456).toExponential(4)","\"-1.2346e+2\""); |
| 147 shouldBe("Number(-123.456).toExponential(5)","\"-1.23456e+2\""); |
| 148 shouldBe("Number(-123.456).toExponential(6)","\"-1.234560e+2\""); |
| 149 shouldBe("Number(-123.456).toExponential(7)","\"-1.2345600e+2\""); |
| 150 shouldBe("Number(-123.456).toExponential(8)","\"-1.23456000e+2\""); |
| 151 shouldBe("Number(-123.456).toExponential(9)","\"-1.234560000e+2\""); |
| 152 shouldBe("Number(-123.456).toExponential(10)","\"-1.2345600000e+2\""); |
| 153 shouldBe("Number(-123.456).toExponential(11)","\"-1.23456000000e+2\""); |
| 154 shouldBe("Number(-123.456).toExponential(12)","\"-1.234560000000e+2\""); |
| 155 shouldBe("Number(-123.456).toExponential(13)","\"-1.2345600000000e+2\""); |
| 156 shouldBe("Number(-123.456).toExponential(14)","\"-1.23456000000000e+2\""); |
| 157 shouldBe("Number(-123.456).toExponential(15)","\"-1.234560000000000e+2\""); |
| 158 shouldBe("Number(-123.456).toExponential(16)","\"-1.2345600000000000e+2\""); |
| 159 shouldBe("Number(-123.456).toExponential(17)","\"-1.23456000000000003e+2\""); |
| 160 shouldBe("Number(-123.456).toExponential(18)","\"-1.234560000000000031e+2\""); |
| 161 shouldBe("Number(-123.456).toExponential(19)","\"-1.2345600000000000307e+2\""); |
| 162 shouldBe("Number(-123.456).toExponential(20)","\"-1.23456000000000003070e+2\""); |
| 163 shouldBeTrue("try { Number(-123.456).toExponential(21) } catch (e) { String(e).i
ndexOf('Range') >= 0; }"); |
| 164 shouldBe("Number(.000123456).toExponential()","\"1.23456e-4\""); |
| 165 shouldBeTrue("try { Number(.000123456).toExponential(-1) } catch (e) { String(e)
.indexOf('Range') >= 0; }"); |
| 166 shouldBe("Number(.000123456).toExponential(0)","\"1e-4\""); |
| 167 shouldBe("Number(.000123456).toExponential(1)","\"1.2e-4\""); |
| 168 shouldBe("Number(.000123456).toExponential(2)","\"1.23e-4\""); |
| 169 shouldBe("Number(.000123456).toExponential(3)","\"1.235e-4\""); |
| 170 shouldBe("Number(.000123456).toExponential(4)","\"1.2346e-4\""); |
| 171 shouldBe("Number(.000123456).toExponential(5)","\"1.23456e-4\""); |
| 172 shouldBe("Number(.000123456).toExponential(6)","\"1.234560e-4\""); |
| 173 shouldBe("Number(.000123456).toExponential(7)","\"1.2345600e-4\""); |
| 174 shouldBe("Number(.000123456).toExponential(8)","\"1.23456000e-4\""); |
| 175 shouldBe("Number(.000123456).toExponential(9)","\"1.234560000e-4\""); |
| 176 shouldBe("Number(.000123456).toExponential(10)","\"1.2345600000e-4\""); |
| 177 shouldBe("Number(.000123456).toExponential(11)","\"1.23456000000e-4\""); |
| 178 shouldBe("Number(.000123456).toExponential(12)","\"1.234560000000e-4\""); |
| 179 shouldBe("Number(.000123456).toExponential(13)","\"1.2345600000000e-4\""); |
| 180 shouldBe("Number(.000123456).toExponential(14)","\"1.23456000000000e-4\""); |
| 181 shouldBe("Number(.000123456).toExponential(15)","\"1.234560000000000e-4\""); |
| 182 shouldBe("Number(.000123456).toExponential(16)","\"1.2345600000000001e-4\""); |
| 183 shouldBe("Number(.000123456).toExponential(17)","\"1.23456000000000005e-4\""); |
| 184 shouldBe("Number(.000123456).toExponential(18)","\"1.234560000000000052e-4\""); |
| 185 shouldBe("Number(.000123456).toExponential(19)","\"1.2345600000000000519e-4\""); |
| 186 shouldBe("Number(.000123456).toExponential(20)","\"1.23456000000000005188e-4\"")
; |
| 187 shouldBeTrue("try { Number(.000123456).toExponential(21) } catch (e) { String(e)
.indexOf('Range') >= 0; }"); |
| 188 shouldBe("Number(-.000123456).toExponential()","\"-1.23456e-4\""); |
| 189 shouldBeTrue("try { Number(-.000123456).toExponential(-1) } catch (e) { String(e
).indexOf('Range') >= 0; }"); |
| 190 shouldBe("Number(-.000123456).toExponential(0)","\"-1e-4\""); |
| 191 shouldBe("Number(-.000123456).toExponential(1)","\"-1.2e-4\""); |
| 192 shouldBe("Number(-.000123456).toExponential(2)","\"-1.23e-4\""); |
| 193 shouldBe("Number(-.000123456).toExponential(3)","\"-1.235e-4\""); |
| 194 shouldBe("Number(-.000123456).toExponential(4)","\"-1.2346e-4\""); |
| 195 shouldBe("Number(-.000123456).toExponential(5)","\"-1.23456e-4\""); |
| 196 shouldBe("Number(-.000123456).toExponential(6)","\"-1.234560e-4\""); |
| 197 shouldBe("Number(-.000123456).toExponential(7)","\"-1.2345600e-4\""); |
| 198 shouldBe("Number(-.000123456).toExponential(8)","\"-1.23456000e-4\""); |
| 199 shouldBe("Number(-.000123456).toExponential(9)","\"-1.234560000e-4\""); |
| 200 shouldBe("Number(-.000123456).toExponential(10)","\"-1.2345600000e-4\""); |
| 201 shouldBe("Number(-.000123456).toExponential(11)","\"-1.23456000000e-4\""); |
| 202 shouldBe("Number(-.000123456).toExponential(12)","\"-1.234560000000e-4\""); |
| 203 shouldBe("Number(-.000123456).toExponential(13)","\"-1.2345600000000e-4\""); |
| 204 shouldBe("Number(-.000123456).toExponential(14)","\"-1.23456000000000e-4\""); |
| 205 shouldBe("Number(-.000123456).toExponential(15)","\"-1.234560000000000e-4\""); |
| 206 shouldBe("Number(-.000123456).toExponential(16)","\"-1.2345600000000001e-4\""); |
| 207 shouldBe("Number(-.000123456).toExponential(17)","\"-1.23456000000000005e-4\""); |
| 208 shouldBe("Number(-.000123456).toExponential(18)","\"-1.234560000000000052e-4\"")
; |
| 209 shouldBe("Number(-.000123456).toExponential(19)","\"-1.2345600000000000519e-4\""
); |
| 210 shouldBe("Number(-.000123456).toExponential(20)","\"-1.23456000000000005188e-4\"
"); |
| 211 shouldBeTrue("try { Number(-.000123456).toExponential(21) } catch (e) { String(e
).indexOf('Range') >= 0; }"); |
| 212 shouldBe("Number(123.4567890123456789012).toExponential()","\"1.2345678901234568
e+2\""); |
| 213 shouldBeTrue("try { Number(123.4567890123456789012).toExponential(-1) } catch (e
) { String(e).indexOf('Range') >= 0; }"); |
| 214 shouldBe("Number(123.4567890123456789012).toExponential(0)","\"1e+2\""); |
| 215 shouldBe("Number(123.4567890123456789012).toExponential(1)","\"1.2e+2\""); |
| 216 shouldBe("Number(123.4567890123456789012).toExponential(2)","\"1.23e+2\""); |
| 217 shouldBe("Number(123.4567890123456789012).toExponential(3)","\"1.235e+2\""); |
| 218 shouldBe("Number(123.4567890123456789012).toExponential(4)","\"1.2346e+2\""); |
| 219 shouldBe("Number(123.4567890123456789012).toExponential(5)","\"1.23457e+2\""); |
| 220 shouldBe("Number(123.4567890123456789012).toExponential(6)","\"1.234568e+2\""); |
| 221 shouldBe("Number(123.4567890123456789012).toExponential(7)","\"1.2345679e+2\""); |
| 222 shouldBe("Number(123.4567890123456789012).toExponential(8)","\"1.23456789e+2\"")
; |
| 223 shouldBe("Number(123.4567890123456789012).toExponential(9)","\"1.234567890e+2\""
); |
| 224 shouldBe("Number(123.4567890123456789012).toExponential(10)","\"1.2345678901e+2\
""); |
| 225 shouldBe("Number(123.4567890123456789012).toExponential(11)","\"1.23456789012e+2
\""); |
| 226 shouldBe("Number(123.4567890123456789012).toExponential(12)","\"1.234567890123e+
2\""); |
| 227 shouldBe("Number(123.4567890123456789012).toExponential(13)","\"1.2345678901235e
+2\""); |
| 228 shouldBe("Number(123.4567890123456789012).toExponential(14)","\"1.23456789012346
e+2\""); |
| 229 shouldBe("Number(123.4567890123456789012).toExponential(15)","\"1.23456789012345
7e+2\""); |
| 230 shouldBe("Number(123.4567890123456789012).toExponential(16)","\"1.23456789012345
68e+2\""); |
| 231 shouldBe("Number(123.4567890123456789012).toExponential(17)","\"1.23456789012345
681e+2\""); |
| 232 shouldBe("Number(123.4567890123456789012).toExponential(18)","\"1.23456789012345
6806e+2\""); |
| 233 shouldBe("Number(123.4567890123456789012).toExponential(19)","\"1.23456789012345
68059e+2\""); |
| 234 shouldBe("Number(123.4567890123456789012).toExponential(20)","\"1.23456789012345
680590e+2\""); |
| 235 shouldBeTrue("try { Number(123.4567890123456789012).toExponential(21) } catch (e
) { String(e).indexOf('Range') >= 0; }"); |
| 236 shouldBe("Number(-123.4567890123456789012).toExponential()","\"-1.23456789012345
68e+2\""); |
| 237 shouldBeTrue("try { Number(-123.4567890123456789012).toExponential(-1) } catch (
e) { String(e).indexOf('Range') >= 0; }"); |
| 238 shouldBe("Number(-123.4567890123456789012).toExponential(0)","\"-1e+2\""); |
| 239 shouldBe("Number(-123.4567890123456789012).toExponential(1)","\"-1.2e+2\""); |
| 240 shouldBe("Number(-123.4567890123456789012).toExponential(2)","\"-1.23e+2\""); |
| 241 shouldBe("Number(-123.4567890123456789012).toExponential(3)","\"-1.235e+2\""); |
| 242 shouldBe("Number(-123.4567890123456789012).toExponential(4)","\"-1.2346e+2\""); |
| 243 shouldBe("Number(-123.4567890123456789012).toExponential(5)","\"-1.23457e+2\""); |
| 244 shouldBe("Number(-123.4567890123456789012).toExponential(6)","\"-1.234568e+2\"")
; |
| 245 shouldBe("Number(-123.4567890123456789012).toExponential(7)","\"-1.2345679e+2\""
); |
| 246 shouldBe("Number(-123.4567890123456789012).toExponential(8)","\"-1.23456789e+2\"
"); |
| 247 shouldBe("Number(-123.4567890123456789012).toExponential(9)","\"-1.234567890e+2\
""); |
| 248 shouldBe("Number(-123.4567890123456789012).toExponential(10)","\"-1.2345678901e+
2\""); |
| 249 shouldBe("Number(-123.4567890123456789012).toExponential(11)","\"-1.23456789012e
+2\""); |
| 250 shouldBe("Number(-123.4567890123456789012).toExponential(12)","\"-1.234567890123
e+2\""); |
| 251 shouldBe("Number(-123.4567890123456789012).toExponential(13)","\"-1.234567890123
5e+2\""); |
| 252 shouldBe("Number(-123.4567890123456789012).toExponential(14)","\"-1.234567890123
46e+2\""); |
| 253 shouldBe("Number(-123.4567890123456789012).toExponential(15)","\"-1.234567890123
457e+2\""); |
| 254 shouldBe("Number(-123.4567890123456789012).toExponential(16)","\"-1.234567890123
4568e+2\""); |
| 255 shouldBe("Number(-123.4567890123456789012).toExponential(17)","\"-1.234567890123
45681e+2\""); |
| 256 shouldBe("Number(-123.4567890123456789012).toExponential(18)","\"-1.234567890123
456806e+2\""); |
| 257 shouldBe("Number(-123.4567890123456789012).toExponential(19)","\"-1.234567890123
4568059e+2\""); |
| 258 shouldBe("Number(-123.4567890123456789012).toExponential(20)","\"-1.234567890123
45680590e+2\""); |
| 259 shouldBeTrue("try { Number(-123.4567890123456789012).toExponential(21) } catch (
e) { String(e).indexOf('Range') >= 0; }"); |
| 260 shouldBe("Number(.0000000000000000000001).toExponential()","\"1e-22\""); |
| 261 shouldBe("Number(.0000000000000000000012).toExponential()","\"1.2e-21\""); |
| 262 shouldBe("Number(.0000000000000000000123).toExponential()","\"1.23e-20\""); |
| 263 shouldBe("Number(.0000000000000000000123).toExponential()","\"1.23e-20\""); |
| 264 shouldBe("Number(.0000000000000000001234).toExponential()","\"1.234e-19\""); |
| 265 shouldBe("Number(.0000000000000000012345).toExponential()","\"1.2345e-18\""); |
| 266 shouldBe("Number(.0000000000000000123456).toExponential()","\"1.23456e-17\""); |
| 267 shouldBe("Number(.0000000000000001234567).toExponential()","\"1.234567e-16\""); |
| 268 shouldBe("Number(.0000000000000012345678).toExponential()","\"1.2345678e-15\""); |
| 269 shouldBe("Number(.0000000000000123456789).toExponential()","\"1.23456789e-14\"")
; |
| 270 shouldBe("Number(.0000000000001234567890).toExponential()","\"1.23456789e-13\"")
; |
| 271 shouldBe("Number(.0000000000012345678901).toExponential()","\"1.2345678901e-12\"
"); |
| 272 shouldBe("Number(.0000000000123456789012).toExponential()","\"1.23456789012e-11\
""); |
| 273 shouldBe("Number(.0000000001234567890123).toExponential()","\"1.234567890123e-10
\""); |
| 274 shouldBe("Number(.0000000012345678901234).toExponential()","\"1.2345678901234e-9
\""); |
| 275 shouldBe("Number(.0000000123456789012345).toExponential()","\"1.23456789012345e-
8\""); |
| 276 shouldBe("Number(.0000001234567890123456).toExponential()","\"1.234567890123456e
-7\""); |
| 277 shouldBe("Number(.0000012345678901234567).toExponential()","\"1.2345678901234567
e-6\""); |
| 278 shouldBe("Number(.0000123456789012345678).toExponential()","\"1.2345678901234568
e-5\""); |
| 279 shouldBe("Number(.0001234567890123456789).toExponential()","\"1.2345678901234567
e-4\""); |
| 280 shouldBe("Number(.0012345678901234567890).toExponential()","\"1.2345678901234567
e-3\""); |
| 281 shouldBe("Number(.0123456789012345678901).toExponential()","\"1.2345678901234568
e-2\""); |
| 282 shouldBe("Number(1.234567890123456789012).toExponential()","\"1.2345678901234567
e+0\""); |
| 283 shouldBe("Number(12.34567890123456789012).toExponential()","\"1.2345678901234567
e+1\""); |
| 284 shouldBe("Number(123.4567890123456789012).toExponential()","\"1.2345678901234568
e+2\""); |
| 285 shouldBe("Number(1234.567890123456789012).toExponential()","\"1.234567890123457e
+3\""); |
| 286 shouldBe("Number(12345.67890123456789012).toExponential()","\"1.2345678901234567
e+4\""); |
| 287 shouldBe("Number(123456.7890123456789012).toExponential()","\"1.2345678901234567
e+5\""); |
| 288 shouldBe("Number(1234567.890123456789012).toExponential()","\"1.2345678901234567
e+6\""); |
| 289 shouldBe("Number(12345678.90123456789012).toExponential()","\"1.2345678901234567
e+7\""); |
| 290 shouldBe("Number(123456789.0123456789012).toExponential()","\"1.2345678901234567
e+8\""); |
| 291 shouldBe("Number(1234567890.123456789012).toExponential()","\"1.2345678901234567
e+9\""); |
| 292 shouldBe("Number(12345678901.23456789012).toExponential()","\"1.2345678901234568
e+10\""); |
| 293 shouldBe("Number(123456789012.3456789012).toExponential()","\"1.2345678901234567
e+11\""); |
| 294 shouldBe("Number(1234567890123.456789012).toExponential()","\"1.2345678901234568
e+12\""); |
| 295 shouldBe("Number(12345678901234.56789012).toExponential()","\"1.2345678901234568
e+13\""); |
| 296 shouldBe("Number(123456789012345.6789012).toExponential()","\"1.2345678901234567
e+14\""); |
| 297 shouldBe("Number(1234567890123456.789012).toExponential()","\"1.2345678901234568
e+15\""); |
| 298 shouldBe("Number(12345678901234567.89012).toExponential()","\"1.2345678901234568
e+16\""); |
| 299 shouldBe("Number(123456789012345678.9012).toExponential()","\"1.2345678901234568
e+17\""); |
| 300 shouldBe("Number(1234567890123456789.012).toExponential()","\"1.2345678901234568
e+18\""); |
| 301 shouldBe("Number(12345678901234567890.12).toExponential()","\"1.2345678901234567
e+19\""); |
| 302 shouldBe("Number(123456789012345678901.2).toExponential()","\"1.2345678901234568
e+20\""); |
| 303 shouldBe("Number(-.0000000000000000000001).toExponential()","\"-1e-22\""); |
| 304 shouldBe("Number(-.0000000000000000000012).toExponential()","\"-1.2e-21\""); |
| 305 shouldBe("Number(-.0000000000000000000123).toExponential()","\"-1.23e-20\""); |
| 306 shouldBe("Number(-.0000000000000000000123).toExponential()","\"-1.23e-20\""); |
| 307 shouldBe("Number(-.0000000000000000001234).toExponential()","\"-1.234e-19\""); |
| 308 shouldBe("Number(-.0000000000000000012345).toExponential()","\"-1.2345e-18\""); |
| 309 shouldBe("Number(-.0000000000000000123456).toExponential()","\"-1.23456e-17\""); |
| 310 shouldBe("Number(-.0000000000000001234567).toExponential()","\"-1.234567e-16\"")
; |
| 311 shouldBe("Number(-.0000000000000012345678).toExponential()","\"-1.2345678e-15\""
); |
| 312 shouldBe("Number(-.0000000000000123456789).toExponential()","\"-1.23456789e-14\"
"); |
| 313 shouldBe("Number(-.0000000000001234567890).toExponential()","\"-1.23456789e-13\"
"); |
| 314 shouldBe("Number(-.0000000000012345678901).toExponential()","\"-1.2345678901e-12
\""); |
| 315 shouldBe("Number(-.0000000000123456789012).toExponential()","\"-1.23456789012e-1
1\""); |
| 316 shouldBe("Number(-.0000000001234567890123).toExponential()","\"-1.234567890123e-
10\""); |
| 317 shouldBe("Number(-.0000000012345678901234).toExponential()","\"-1.2345678901234e
-9\""); |
| 318 shouldBe("Number(-.0000000123456789012345).toExponential()","\"-1.23456789012345
e-8\""); |
| 319 shouldBe("Number(-.0000001234567890123456).toExponential()","\"-1.23456789012345
6e-7\""); |
| 320 shouldBe("Number(-.0000012345678901234567).toExponential()","\"-1.23456789012345
67e-6\""); |
| 321 shouldBe("Number(-.0000123456789012345678).toExponential()","\"-1.23456789012345
68e-5\""); |
| 322 shouldBe("Number(-.0001234567890123456789).toExponential()","\"-1.23456789012345
67e-4\""); |
| 323 shouldBe("Number(-.0012345678901234567890).toExponential()","\"-1.23456789012345
67e-3\""); |
| 324 shouldBe("Number(-.0123456789012345678901).toExponential()","\"-1.23456789012345
68e-2\""); |
| 325 shouldBe("Number(-1.234567890123456789012).toExponential()","\"-1.23456789012345
67e+0\""); |
| 326 shouldBe("Number(-12.34567890123456789012).toExponential()","\"-1.23456789012345
67e+1\""); |
| 327 shouldBe("Number(-123.4567890123456789012).toExponential()","\"-1.23456789012345
68e+2\""); |
| 328 shouldBe("Number(-1234.567890123456789012).toExponential()","\"-1.23456789012345
7e+3\""); |
| 329 shouldBe("Number(-12345.67890123456789012).toExponential()","\"-1.23456789012345
67e+4\""); |
| 330 shouldBe("Number(-123456.7890123456789012).toExponential()","\"-1.23456789012345
67e+5\""); |
| 331 shouldBe("Number(-1234567.890123456789012).toExponential()","\"-1.23456789012345
67e+6\""); |
| 332 shouldBe("Number(-12345678.90123456789012).toExponential()","\"-1.23456789012345
67e+7\""); |
| 333 shouldBe("Number(-123456789.0123456789012).toExponential()","\"-1.23456789012345
67e+8\""); |
| 334 shouldBe("Number(-1234567890.123456789012).toExponential()","\"-1.23456789012345
67e+9\""); |
| 335 shouldBe("Number(-12345678901.23456789012).toExponential()","\"-1.23456789012345
68e+10\""); |
| 336 shouldBe("Number(-123456789012.3456789012).toExponential()","\"-1.23456789012345
67e+11\""); |
| 337 shouldBe("Number(-1234567890123.456789012).toExponential()","\"-1.23456789012345
68e+12\""); |
| 338 shouldBe("Number(-12345678901234.56789012).toExponential()","\"-1.23456789012345
68e+13\""); |
| 339 shouldBe("Number(-123456789012345.6789012).toExponential()","\"-1.23456789012345
67e+14\""); |
| 340 shouldBe("Number(-1234567890123456.789012).toExponential()","\"-1.23456789012345
68e+15\""); |
| 341 shouldBe("Number(-12345678901234567.89012).toExponential()","\"-1.23456789012345
68e+16\""); |
| 342 shouldBe("Number(-123456789012345678.9012).toExponential()","\"-1.23456789012345
68e+17\""); |
| 343 shouldBe("Number(-1234567890123456789.012).toExponential()","\"-1.23456789012345
68e+18\""); |
| 344 shouldBe("Number(-12345678901234567890.12).toExponential()","\"-1.23456789012345
67e+19\""); |
| 345 shouldBe("Number(-123456789012345678901.2).toExponential()","\"-1.23456789012345
68e+20\""); |
| 346 |
| 347 shouldBeTrue("try { Number(1).toPrecision(-1); } catch (e) { String(e).indexOf('
Range') >= 0; }"); |
| 348 shouldBeTrue("try { Number(1).toPrecision(0); } catch (e) { String(e).indexOf('R
ange') >= 0; }"); |
| 349 shouldBe("try { Number(1).toPrecision(1); } catch (e) { String(e); }","\"1\""); |
| 350 shouldBe("try { Number(1).toPrecision(21); } catch (e) { String(e); }","\"1.0000
0000000000000000\""); |
| 351 shouldBeTrue("try { Number(1).toPrecision(22); } catch (e) { String(e).indexOf('
Range') >= 0; }"); |
| 352 shouldBe("Number(NaN).toPrecision()","\"NaN\""); |
| 353 shouldBe("Number(NaN).toPrecision(1)","\"NaN\""); |
| 354 shouldBe("Number(Infinity).toPrecision()","\"Infinity\""); |
| 355 shouldBe("Number(Infinity).toPrecision(1)","\"Infinity\""); |
| 356 shouldBe("Number(-Infinity).toPrecision()","\"-Infinity\""); |
| 357 shouldBe("Number(-Infinity).toPrecision(1)","\"-Infinity\""); |
| 358 shouldBe("Number(.0000000012345).toPrecision(2)","\"1.2e-9\""); |
| 359 shouldBe("Number(.000000012345).toPrecision(2)","\"1.2e-8\""); |
| 360 shouldBe("Number(.00000012345).toPrecision(2)","\"1.2e-7\""); |
| 361 shouldBe("Number(.0000012345).toPrecision(2)","\"0.0000012\""); |
| 362 shouldBe("Number(.000012345).toPrecision(2)","\"0.000012\""); |
| 363 shouldBe("Number(.00012345).toPrecision(2)","\"0.00012\""); |
| 364 shouldBe("Number(.0012345).toPrecision(2)","\"0.0012\""); |
| 365 shouldBe("Number(.012345).toPrecision(2)","\"0.012\""); |
| 366 shouldBe("Number(.12345).toPrecision(2)","\"0.12\""); |
| 367 shouldBe("Number(1.2345).toPrecision(2)","\"1.2\""); |
| 368 shouldBe("Number(12.345).toPrecision(2)","\"12\""); |
| 369 shouldBe("Number(123.45).toPrecision(2)","\"1.2e+2\""); |
| 370 shouldBe("Number(1234.5).toPrecision(2)","\"1.2e+3\""); |
| 371 shouldBe("Number(12345).toPrecision(2)","\"1.2e+4\""); |
| 372 shouldBe("Number(12345.67).toPrecision(4)","\"1.235e+4\""); |
| 373 shouldBe("Number(12344.67).toPrecision(4)","\"1.234e+4\""); |
| 374 shouldBe("Number(0.0001234567890123456789012345).toPrecision()","\"0.00012345678
901234567\""); |
| 375 shouldBe("Number(0.0001234567890123456789012345).toPrecision(1)","\"0.0001\""); |
| 376 shouldBe("Number(0.0001234567890123456789012345).toPrecision(2)","\"0.00012\""); |
| 377 shouldBe("Number(0.0001234567890123456789012345).toPrecision(3)","\"0.000123\"")
; |
| 378 shouldBe("Number(0.0001234567890123456789012345).toPrecision(4)","\"0.0001235\""
); |
| 379 shouldBe("Number(0.0001234567890123456789012345).toPrecision(5)","\"0.00012346\"
"); |
| 380 shouldBe("Number(0.0001234567890123456789012345).toPrecision(6)","\"0.000123457\
""); |
| 381 shouldBe("Number(0.0001234567890123456789012345).toPrecision(7)","\"0.0001234568
\""); |
| 382 shouldBe("Number(0.0001234567890123456789012345).toPrecision(8)","\"0.0001234567
9\""); |
| 383 shouldBe("Number(0.0001234567890123456789012345).toPrecision(9)","\"0.0001234567
89\""); |
| 384 shouldBe("Number(0.0001234567890123456789012345).toPrecision(10)","\"0.000123456
7890\""); |
| 385 shouldBe("Number(0.0001234567890123456789012345).toPrecision(11)","\"0.000123456
78901\""); |
| 386 shouldBe("Number(0.0001234567890123456789012345).toPrecision(12)","\"0.000123456
789012\""); |
| 387 shouldBe("Number(0.0001234567890123456789012345).toPrecision(13)","\"0.000123456
7890123\""); |
| 388 shouldBe("Number(0.0001234567890123456789012345).toPrecision(14)","\"0.000123456
78901235\""); |
| 389 shouldBe("Number(0.0001234567890123456789012345).toPrecision(15)","\"0.000123456
789012346\""); |
| 390 shouldBe("Number(0.0001234567890123456789012345).toPrecision(16)","\"0.000123456
7890123457\""); |
| 391 shouldBe("Number(0.0001234567890123456789012345).toPrecision(17)","\"0.000123456
78901234567\""); |
| 392 shouldBe("Number(0.0001234567890123456789012345).toPrecision(18)","\"0.000123456
789012345671\""); |
| 393 shouldBe("Number(0.0001234567890123456789012345).toPrecision(19)","\"0.000123456
7890123456713\""); |
| 394 shouldBe("Number(0.0001234567890123456789012345).toPrecision(20)","\"0.000123456
78901234567130\""); |
| 395 shouldBe("Number(0.0001234567890123456789012345).toPrecision(21)","\"0.000123456
789012345671298\""); |
| 396 shouldBe("Number(12345.67890123456789012345).toPrecision()","\"12345.67890123456
7\""); |
| 397 shouldBe("Number(12345.67890123456789012345).toPrecision(1)","\"1e+4\""); |
| 398 shouldBe("Number(12345.67890123456789012345).toPrecision(2)","\"1.2e+4\""); |
| 399 shouldBe("Number(12345.67890123456789012345).toPrecision(3)","\"1.23e+4\""); |
| 400 shouldBe("Number(12345.67890123456789012345).toPrecision(4)","\"1.235e+4\""); |
| 401 shouldBe("Number(12345.67890123456789012345).toPrecision(5)","\"12346\""); |
| 402 shouldBe("Number(12345.67890123456789012345).toPrecision(6)","\"12345.7\""); |
| 403 shouldBe("Number(12345.67890123456789012345).toPrecision(7)","\"12345.68\""); |
| 404 shouldBe("Number(12345.67890123456789012345).toPrecision(8)","\"12345.679\""); |
| 405 shouldBe("Number(12345.67890123456789012345).toPrecision(9)","\"12345.6789\""); |
| 406 shouldBe("Number(12345.67890123456789012345).toPrecision(10)","\"12345.67890\"")
; |
| 407 shouldBe("Number(12345.67890123456789012345).toPrecision(11)","\"12345.678901\""
); |
| 408 shouldBe("Number(12345.67890123456789012345).toPrecision(12)","\"12345.6789012\"
"); |
| 409 shouldBe("Number(12345.67890123456789012345).toPrecision(13)","\"12345.67890123\
""); |
| 410 shouldBe("Number(12345.67890123456789012345).toPrecision(14)","\"12345.678901235
\""); |
| 411 shouldBe("Number(12345.67890123456789012345).toPrecision(15)","\"12345.678901234
6\""); |
| 412 shouldBe("Number(12345.67890123456789012345).toPrecision(16)","\"12345.678901234
57\""); |
| 413 shouldBe("Number(12345.67890123456789012345).toPrecision(17)","\"12345.678901234
567\""); |
| 414 shouldBe("Number(12345.67890123456789012345).toPrecision(18)","\"12345.678901234
5671\""); |
| 415 shouldBe("Number(12345.67890123456789012345).toPrecision(19)","\"12345.678901234
56709\""); |
| 416 shouldBe("Number(12345.67890123456789012345).toPrecision(20)","\"12345.678901234
567093\""); |
| 417 shouldBe("Number(12345.67890123456789012345).toPrecision(21)","\"12345.678901234
5670926\""); |
| 418 shouldBe("Number(-.0000000012345).toPrecision(2)","\"-1.2e-9\""); |
| 419 shouldBe("Number(-.000000012345).toPrecision(2)","\"-1.2e-8\""); |
| 420 shouldBe("Number(-.00000012345).toPrecision(2)","\"-1.2e-7\""); |
| 421 shouldBe("Number(-.0000012345).toPrecision(2)","\"-0.0000012\""); |
| 422 shouldBe("Number(-.000012345).toPrecision(2)","\"-0.000012\""); |
| 423 shouldBe("Number(-.00012345).toPrecision(2)","\"-0.00012\""); |
| 424 shouldBe("Number(-.0012345).toPrecision(2)","\"-0.0012\""); |
| 425 shouldBe("Number(-.012345).toPrecision(2)","\"-0.012\""); |
| 426 shouldBe("Number(-.12345).toPrecision(2)","\"-0.12\""); |
| 427 shouldBe("Number(-1.2345).toPrecision(2)","\"-1.2\""); |
| 428 shouldBe("Number(-12.345).toPrecision(2)","\"-12\""); |
| 429 shouldBe("Number(-123.45).toPrecision(2)","\"-1.2e+2\""); |
| 430 shouldBe("Number(-1234.5).toPrecision(2)","\"-1.2e+3\""); |
| 431 shouldBe("Number(-12345).toPrecision(2)","\"-1.2e+4\""); |
| 432 shouldBe("Number(-12345.67).toPrecision(4)","\"-1.235e+4\""); |
| 433 shouldBe("Number(-12344.67).toPrecision(4)","\"-1.234e+4\""); |
| 434 shouldBe("Number(-0.0001234567890123456789012345).toPrecision()","\"-0.000123456
78901234567\""); |
| 435 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(1)","\"-0.0001\"")
; |
| 436 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(2)","\"-0.00012\""
); |
| 437 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(3)","\"-0.000123\"
"); |
| 438 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(4)","\"-0.0001235\
""); |
| 439 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(5)","\"-0.00012346
\""); |
| 440 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(6)","\"-0.00012345
7\""); |
| 441 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(7)","\"-0.00012345
68\""); |
| 442 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(8)","\"-0.00012345
679\""); |
| 443 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(9)","\"-0.00012345
6789\""); |
| 444 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(10)","\"-0.0001234
567890\""); |
| 445 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(11)","\"-0.0001234
5678901\""); |
| 446 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(12)","\"-0.0001234
56789012\""); |
| 447 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(13)","\"-0.0001234
567890123\""); |
| 448 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(14)","\"-0.0001234
5678901235\""); |
| 449 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(15)","\"-0.0001234
56789012346\""); |
| 450 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(16)","\"-0.0001234
567890123457\""); |
| 451 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(17)","\"-0.0001234
5678901234567\""); |
| 452 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(18)","\"-0.0001234
56789012345671\""); |
| 453 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(19)","\"-0.0001234
567890123456713\""); |
| 454 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(20)","\"-0.0001234
5678901234567130\""); |
| 455 shouldBe("Number(-0.0001234567890123456789012345).toPrecision(21)","\"-0.0001234
56789012345671298\""); |
| 456 shouldBe("Number(-12345.67890123456789012345).toPrecision()","\"-12345.678901234
567\""); |
| 457 shouldBe("Number(-12345.67890123456789012345).toPrecision(1)","\"-1e+4\""); |
| 458 shouldBe("Number(-12345.67890123456789012345).toPrecision(2)","\"-1.2e+4\""); |
| 459 shouldBe("Number(-12345.67890123456789012345).toPrecision(3)","\"-1.23e+4\""); |
| 460 shouldBe("Number(-12345.67890123456789012345).toPrecision(4)","\"-1.235e+4\""); |
| 461 shouldBe("Number(-12345.67890123456789012345).toPrecision(5)","\"-12346\""); |
| 462 shouldBe("Number(-12345.67890123456789012345).toPrecision(6)","\"-12345.7\""); |
| 463 shouldBe("Number(-12345.67890123456789012345).toPrecision(7)","\"-12345.68\""); |
| 464 shouldBe("Number(-12345.67890123456789012345).toPrecision(8)","\"-12345.679\""); |
| 465 shouldBe("Number(-12345.67890123456789012345).toPrecision(9)","\"-12345.6789\"")
; |
| 466 shouldBe("Number(-12345.67890123456789012345).toPrecision(10)","\"-12345.67890\"
"); |
| 467 shouldBe("Number(-12345.67890123456789012345).toPrecision(11)","\"-12345.678901\
""); |
| 468 shouldBe("Number(-12345.67890123456789012345).toPrecision(12)","\"-12345.6789012
\""); |
| 469 shouldBe("Number(-12345.67890123456789012345).toPrecision(13)","\"-12345.6789012
3\""); |
| 470 shouldBe("Number(-12345.67890123456789012345).toPrecision(14)","\"-12345.6789012
35\""); |
| 471 shouldBe("Number(-12345.67890123456789012345).toPrecision(15)","\"-12345.6789012
346\""); |
| 472 shouldBe("Number(-12345.67890123456789012345).toPrecision(16)","\"-12345.6789012
3457\""); |
| 473 shouldBe("Number(-12345.67890123456789012345).toPrecision(17)","\"-12345.6789012
34567\""); |
| 474 shouldBe("Number(-12345.67890123456789012345).toPrecision(18)","\"-12345.6789012
345671\""); |
| 475 shouldBe("Number(-12345.67890123456789012345).toPrecision(19)","\"-12345.6789012
3456709\""); |
| 476 shouldBe("Number(-12345.67890123456789012345).toPrecision(20)","\"-12345.6789012
34567093\""); |
| 477 shouldBe("Number(-12345.67890123456789012345).toPrecision(21)","\"-12345.6789012
345670926\""); |
| 478 shouldBe("Number(0).toPrecision()","\"0\""); |
| 479 shouldBe("Number(0).toPrecision(1)","\"0\""); |
| 480 shouldBe("Number(0).toPrecision(2)","\"0.0\""); |
| 481 shouldBe("Number(0).toPrecision(3)","\"0.00\""); |
| 482 shouldBe("Number(0).toPrecision(4)","\"0.000\""); |
| 483 shouldBe("Number(0).toPrecision(5)","\"0.0000\""); |
| 484 shouldBe("Number(0).toPrecision(6)","\"0.00000\""); |
| 485 shouldBe("Number(0).toPrecision(7)","\"0.000000\""); |
| 486 shouldBe("Number(0).toPrecision(8)","\"0.0000000\""); |
| 487 shouldBe("Number(0).toPrecision(9)","\"0.00000000\""); |
| 488 shouldBe("Number(0).toPrecision(10)","\"0.000000000\""); |
| 489 shouldBe("Number(0).toPrecision(11)","\"0.0000000000\""); |
| 490 shouldBe("Number(0).toPrecision(12)","\"0.00000000000\""); |
| 491 shouldBe("Number(0).toPrecision(13)","\"0.000000000000\""); |
| 492 shouldBe("Number(0).toPrecision(14)","\"0.0000000000000\""); |
| 493 shouldBe("Number(0).toPrecision(15)","\"0.00000000000000\""); |
| 494 shouldBe("Number(0).toPrecision(16)","\"0.000000000000000\""); |
| 495 shouldBe("Number(0).toPrecision(17)","\"0.0000000000000000\""); |
| 496 shouldBe("Number(0).toPrecision(18)","\"0.00000000000000000\""); |
| 497 shouldBe("Number(0).toPrecision(19)","\"0.000000000000000000\""); |
| 498 shouldBe("Number(0).toPrecision(20)","\"0.0000000000000000000\""); |
| 499 shouldBe("Number(0).toPrecision(21)","\"0.00000000000000000000\""); |
OLD | NEW |