test/script/basic/JDK-8135000.js

Tue, 21 Mar 2017 13:41:57 -0700

author
asaha
date
Tue, 21 Mar 2017 13:41:57 -0700
changeset 2160
1df40fe54cd6
parent 1545
16fb36bc0bd8
permissions
-rw-r--r--

Merge

hannesw@1545 1 /*
hannesw@1545 2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
hannesw@1545 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
hannesw@1545 4 *
hannesw@1545 5 * This code is free software; you can redistribute it and/or modify it
hannesw@1545 6 * under the terms of the GNU General Public License version 2 only, as
hannesw@1545 7 * published by the Free Software Foundation.
hannesw@1545 8 *
hannesw@1545 9 * This code is distributed in the hope that it will be useful, but WITHOUT
hannesw@1545 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
hannesw@1545 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
hannesw@1545 12 * version 2 for more details (a copy is included in the LICENSE file that
hannesw@1545 13 * accompanied this code).
hannesw@1545 14 *
hannesw@1545 15 * You should have received a copy of the GNU General Public License version
hannesw@1545 16 * 2 along with this work; if not, write to the Free Software Foundation,
hannesw@1545 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
hannesw@1545 18 *
hannesw@1545 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
hannesw@1545 20 * or visit www.oracle.com if you need additional information or have any
hannesw@1545 21 * questions.
hannesw@1545 22 */
hannesw@1545 23
hannesw@1545 24 /**
hannesw@1545 25 * JDK-8135000: Number.prototype.toFixed returns wrong string for 0.5 and -0.5
hannesw@1545 26 *
hannesw@1545 27 * @test
hannesw@1545 28 * @run
hannesw@1545 29 */
hannesw@1545 30
hannesw@1545 31 print(-2.6.toFixed());
hannesw@1545 32 print(-2.5.toFixed());
hannesw@1545 33 print(-2.4.toFixed());
hannesw@1545 34 print(-1.6.toFixed());
hannesw@1545 35 print(-1.5.toFixed());
hannesw@1545 36 print(-1.4.toFixed());
hannesw@1545 37 print(-0.6.toFixed());
hannesw@1545 38 print(-0.5.toFixed());
hannesw@1545 39 print(-0.4.toFixed());
hannesw@1545 40 print(0.4.toFixed());
hannesw@1545 41 print(0.5.toFixed());
hannesw@1545 42 print(0.6.toFixed());
hannesw@1545 43 print(1.4.toFixed());
hannesw@1545 44 print(1.5.toFixed());
hannesw@1545 45 print(1.6.toFixed());
hannesw@1545 46 print(2.4.toFixed());
hannesw@1545 47 print(2.5.toFixed());
hannesw@1545 48 print(2.6.toFixed());

mercurial