hannesw@1545: /* hannesw@1545: * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. hannesw@1545: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hannesw@1545: * hannesw@1545: * This code is free software; you can redistribute it and/or modify it hannesw@1545: * under the terms of the GNU General Public License version 2 only, as hannesw@1545: * published by the Free Software Foundation. hannesw@1545: * hannesw@1545: * This code is distributed in the hope that it will be useful, but WITHOUT hannesw@1545: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hannesw@1545: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hannesw@1545: * version 2 for more details (a copy is included in the LICENSE file that hannesw@1545: * accompanied this code). hannesw@1545: * hannesw@1545: * You should have received a copy of the GNU General Public License version hannesw@1545: * 2 along with this work; if not, write to the Free Software Foundation, hannesw@1545: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hannesw@1545: * hannesw@1545: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hannesw@1545: * or visit www.oracle.com if you need additional information or have any hannesw@1545: * questions. hannesw@1545: */ hannesw@1545: hannesw@1545: /** hannesw@1545: * JDK-8135000: Number.prototype.toFixed returns wrong string for 0.5 and -0.5 hannesw@1545: * hannesw@1545: * @test hannesw@1545: * @run hannesw@1545: */ hannesw@1545: hannesw@1545: print(-2.6.toFixed()); hannesw@1545: print(-2.5.toFixed()); hannesw@1545: print(-2.4.toFixed()); hannesw@1545: print(-1.6.toFixed()); hannesw@1545: print(-1.5.toFixed()); hannesw@1545: print(-1.4.toFixed()); hannesw@1545: print(-0.6.toFixed()); hannesw@1545: print(-0.5.toFixed()); hannesw@1545: print(-0.4.toFixed()); hannesw@1545: print(0.4.toFixed()); hannesw@1545: print(0.5.toFixed()); hannesw@1545: print(0.6.toFixed()); hannesw@1545: print(1.4.toFixed()); hannesw@1545: print(1.5.toFixed()); hannesw@1545: print(1.6.toFixed()); hannesw@1545: print(2.4.toFixed()); hannesw@1545: print(2.5.toFixed()); hannesw@1545: print(2.6.toFixed());