michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: File Name: 7.7.3-1.js michael@0: ECMA Section: 7.7.3 Numeric Literals michael@0: michael@0: Description: A numeric literal stands for a value of the Number type michael@0: This value is determined in two steps: first a michael@0: mathematical value (MV) is derived from the literal; michael@0: second, this mathematical value is rounded, ideally michael@0: using IEEE 754 round-to-nearest mode, to a reprentable michael@0: value of of the number type. michael@0: michael@0: These test cases came from Waldemar. michael@0: michael@0: Author: christine@netscape.com michael@0: Date: 12 June 1998 michael@0: */ michael@0: michael@0: var SECTION = "7.7.3-1"; michael@0: var VERSION = "ECMA_1"; michael@0: var TITLE = "Numeric Literals"; michael@0: var BUGNUMBER="122877"; michael@0: michael@0: startTest(); michael@0: michael@0: writeHeaderToLog( SECTION + " "+ TITLE); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x12345678", michael@0: 305419896, michael@0: 0x12345678 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x80000000", michael@0: 2147483648, michael@0: 0x80000000 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0xffffffff", michael@0: 4294967295, michael@0: 0xffffffff ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x100000000", michael@0: 4294967296, michael@0: 0x100000000 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "077777777777777777", michael@0: 2251799813685247, michael@0: 077777777777777777 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "077777777777777776", michael@0: 2251799813685246, michael@0: 077777777777777776 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x1fffffffffffff", michael@0: 9007199254740991, michael@0: 0x1fffffffffffff ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x20000000000000", michael@0: 9007199254740992, michael@0: 0x20000000000000 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x20123456789abc", michael@0: 9027215253084860, michael@0: 0x20123456789abc ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x20123456789abd", michael@0: 9027215253084860, michael@0: 0x20123456789abd ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x20123456789abe", michael@0: 9027215253084862, michael@0: 0x20123456789abe ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x20123456789abf", michael@0: 9027215253084864, michael@0: 0x20123456789abf ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x1000000000000080", michael@0: 1152921504606847000, michael@0: 0x1000000000000080 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x1000000000000081", michael@0: 1152921504606847200, michael@0: 0x1000000000000081 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x1000000000000100", michael@0: 1152921504606847200, michael@0: 0x1000000000000100 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x100000000000017f", michael@0: 1152921504606847200, michael@0: 0x100000000000017f ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x1000000000000180", michael@0: 1152921504606847500, michael@0: 0x1000000000000180 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x1000000000000181", michael@0: 1152921504606847500, michael@0: 0x1000000000000181 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x10000000000001f0", michael@0: 1152921504606847500, michael@0: 0x10000000000001f0 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x1000000000000200", michael@0: 1152921504606847500, michael@0: 0x1000000000000200 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x100000000000027f", michael@0: 1152921504606847500, michael@0: 0x100000000000027f ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x1000000000000280", michael@0: 1152921504606847500, michael@0: 0x1000000000000280 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x1000000000000281", michael@0: 1152921504606847700, michael@0: 0x1000000000000281 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x10000000000002ff", michael@0: 1152921504606847700, michael@0: 0x10000000000002ff ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x1000000000000300", michael@0: 1152921504606847700, michael@0: 0x1000000000000300 ); michael@0: michael@0: new TestCase( SECTION, michael@0: "0x10000000000000000", michael@0: 18446744073709552000, michael@0: 0x10000000000000000 ); michael@0: michael@0: test(); michael@0: