Debian Codegraph @

rhino/testsrc/tests/ecma/LexicalConventions/7.7.3-1.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 gTestfile = '7.7.3-1.js';
7
8 /**
9 File Name: 7.7.3-1.js
10 ECMA Section: 7.7.3 Numeric Literals
11
12 Description: A numeric literal stands for a value of the Number type
13 This value is determined in two steps: first a
14 mathematical value (MV) is derived from the literal;
15 second, this mathematical value is rounded, ideally
16 using IEEE 754 round-to-nearest mode, to a reprentable
17 value of of the number type.
18
19 These test cases came from Waldemar.
20
21 Author: [email protected]
22 Date: 12 June 1998
23 */
24
25 var SECTION = "7.7.3-1";
26 var VERSION = "ECMA_1";
27 var TITLE = "Numeric Literals";
28 var BUGNUMBER="122877";
29
30 startTest();
31
32 writeHeaderToLog( SECTION + " "+ TITLE);
33
34 new TestCase( SECTION,
35 "0x12345678",
36 305419896,
37 0x12345678 );
38
39 new TestCase( SECTION,
40 "0x80000000",
41 2147483648,
42 0x80000000 );
43
44 new TestCase( SECTION,
45 "0xffffffff",
46 4294967295,
47 0xffffffff );
48
49 new TestCase( SECTION,
50 "0x100000000",
51 4294967296,
52 0x100000000 );
53
54 new TestCase( SECTION,
55 "077777777777777777",
56 2251799813685247,
57 077777777777777777 );
58
59 new TestCase( SECTION,
60 "077777777777777776",
61 2251799813685246,
62 077777777777777776 );
63
64 new TestCase( SECTION,
65 "0x1fffffffffffff",
66 9007199254740991,
67 0x1fffffffffffff );
68
69 new TestCase( SECTION,
70 "0x20000000000000",
71 9007199254740992,
72 0x20000000000000 );
73
74 new TestCase( SECTION,
75 "0x20123456789abc",
76 9027215253084860,
77 0x20123456789abc );
78
79 new TestCase( SECTION,
80 "0x20123456789abd",
81 9027215253084860,
82 0x20123456789abd );
83
84 new TestCase( SECTION,
85 "0x20123456789abe",
86 9027215253084862,
87 0x20123456789abe );
88
89 new TestCase( SECTION,
90 "0x20123456789abf",
91 9027215253084864,
92 0x20123456789abf );
93
94 new TestCase( SECTION,
95 "0x1000000000000080",
96 1152921504606847000,
97 0x1000000000000080 );
98
99 new TestCase( SECTION,
100 "0x1000000000000081",
101 1152921504606847200,
102 0x1000000000000081 );
103
104 new TestCase( SECTION,
105 "0x1000000000000100",
106 1152921504606847200,
107 0x1000000000000100 );
108
109 new TestCase( SECTION,
110 "0x100000000000017f",
111 1152921504606847200,
112 0x100000000000017f );
113
114 new TestCase( SECTION,
115 "0x1000000000000180",
116 1152921504606847500,
117 0x1000000000000180 );
118
119 new TestCase( SECTION,
120 "0x1000000000000181",
121 1152921504606847500,
122 0x1000000000000181 );
123
124 new TestCase( SECTION,
125 "0x10000000000001f0",
126 1152921504606847500,
127 0x10000000000001f0 );
128
129 new TestCase( SECTION,
130 "0x1000000000000200",
131 1152921504606847500,
132 0x1000000000000200 );
133
134 new TestCase( SECTION,
135 "0x100000000000027f",
136 1152921504606847500,
137 0x100000000000027f );
138
139 new TestCase( SECTION,
140 "0x1000000000000280",
141 1152921504606847500,
142 0x1000000000000280 );
143
144 new TestCase( SECTION,
145 "0x1000000000000281",
146 1152921504606847700,
147 0x1000000000000281 );
148
149 new TestCase( SECTION,
150 "0x10000000000002ff",
151 1152921504606847700,
152 0x10000000000002ff );
153
154 new TestCase( SECTION,
155 "0x1000000000000300",
156 1152921504606847700,
157 0x1000000000000300 );
158
159 new TestCase( SECTION,
160 "0x10000000000000000",
161 18446744073709552000,
162 0x10000000000000000 );
163
164 test();
165