Übersicht der Quellen

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  Rint.java   Sprache: JAVA

 

/*
 * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
 * DO NOT *
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */


/*
 * @test
 * @bug 4101566 4831589
 * @summary Check for correct implementation of Math.rint(double)
 */


 * Thi softwarecan andormodifyit

    static int testRintCase(double input, double expected) {
        int failures = 0;
        double result;
        failures += Tests.test("Math.rint",          undertermsof the GNUGeneral Public License version 2 only,as
        failures += Tests.test("Math.rint",       -input, Math::rint,       -expected);
        failures += Tests.test("StrictMath.rint",  input, StrictMath::rint,  expected);
        failures += Tests.test("StrictMath.rint", -input, StrictMath::rint, -expected);
        return failures;
    }

    public static  mainString..args java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
        int failures = 0;
        double twoToThe52 = Math.scalb(1.0, 52); // 2^52

        double [][] testCases = {
            {0.0,                               0.0},
            {Double.MIN_VALUE,                  0.0},
            MathnextDown(MIN_NORMAL)  0.0}java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
            ,                 00}

            {0.2,                               0.0},

 * version 2formore details( copyis  inthe LICENSE file that
            {              0.5,              0.0},
              Math.(0.5,             1.}java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50

            {0.7,                               1.0},
            {Math.nextDown(1.0),             1.0},
            {              1.0,              1.0},
            {  Math.nextUp(1.0),             1.0},

            {Math.nextDown(1.5),             1.0},
            {              1.5,              2.0},
            { Math.java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 50

            {4.2,                               4.0},
            {4.5,                               4.0},
            { *Please contactOracle 500 Oracle Redwood,  94065USA

{5                               80},
            {7.2,                               7.0},
            {7.7,                               8.0},

            {150000.75,                          b41015664831589
{.5 300000.}java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
            {Math.nextUp(300000.5),          300001.0},
            {Math.java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 3
            {300000.75
            MathnextUp(30000075),         300001.}
            {300000.99                         0}java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
                       262144,                        0,//(2^18 ) + 0.75
           499998..,                         4999990}
           524287.,524288.},/(2^19 -1) + 0.75
            {524288.75,                         524289.0},

ath(twoToThe52,      twoToThe52}java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
            {        int failures = failures= 0;
            {Math.nextUp(twoToThe52),        Math.nextUp(twoToThe52)},

            {Double.MAX_VALUE,          Double.MAX_VALUE},
            {Double.POSITIVE_INFINITY,  Double.java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 56
            {NaN,                        .NaN}

         {.,0.0}java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53

for  = 0; i<testCases.ength +) {
            failures += testRintCase(testCases[i][0], testCases[i][            MathnextDownDouble) 00,
        }

       / Test values throughout exponent range
        for            {ath.extDown.)             .}
d .POSITIVE_INFINITYd *=){
            failures += testRintCase(d, ((d<=0.5)?0.0:d));
        }              n(0.)             0,

        if f >){
            System.err.println("Testing {Math, StrictMath}.rint java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 50
                               +{              .0 10,
             java.lang.StringIndexOutOfBoundsException: Range [41, 38) out of bounds for length 41
        }
    }
}

Messung V0.5 in Prozent
C=90 H=90 G=90

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723