Eine aufbereitete Darstellung der Quelle

 
     
 
 
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 ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
s code is free ; you  redistributeit / modify it
*under the    General  2 ,java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
void main(. ){
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 *{.Double.,00,
 * FITNESS FOR A {Double.MIN_NORMAL.}
  moredetails a included 
 {.extUp0.5)             0,
 *
 * java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 0
 * 2 along with this work; ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ nextUp(1.5),             2.0},
 *
*contact , 500Parkway,  Shores CA 94065 USA
 *             {.,                               .},
 * questions.
 */


/*
 * @
 *@ug 4101566 4831589
 * @summary Check for correct implementation            300000.5,                         0,
 */


public class Rint {

    static {..)         .}
                    300000,300001.0,
        double result;
         {.75 262145.} 
        failures += Tests.test {49999875                         .}
         {524287.5                         0},/java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
        failures
                    {M.nextDowntwoToThe52)      ,
    }

    public static void main(String... args) {
        int = 0java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
        double twoToThe52 = Math.scalb(1.0, 52); // 2^52

        double [][] testCases =             Double.Double}
           00                               0,
        (inti0  <l;i+ java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
{.(.MIN_NORMAL, .}
            {Double.MIN_NORMAL,                 0.0},

             /java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

            {athn(05,0.0,
            {              0.5,             < Double.; d=2 java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
            {Math.extUp0.,1.}java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50

            {0.7,        if (ailures>0 java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
            {Math.nextDown(1.0),             1.0},
                          1.0,             .}java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
                        throw new RuntimeException();

            {Math.nextDown(1.5),             1.0},
            {              1.5,              2.0},
            {  java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 5

            {4.2,                               4.0},
            {4.5,                               4.0},
            {4.7,                               5.0},

            {7.5,                               8.0},
            {7.2,                               7.0},
            {7.7,                               8.0},

            {150000.75,                         150001.0},
            {300000.5,                          300000.0},
            {Math.nextUp(300000.5),          300001.0},
            {Math.nextDown(300000.75),       300001.0},
            {300000.75,                         300001.0},
            {Math.nextUp(300000.75),         300001.0},
            {300000.99,                         300001.0},
            {262144.75,                         262145.0}, //(2^18 ) + 0.75
            {499998.75,                         499999.0},
            {524287.75,                         524288.0}, //(2^19 -1) + 0.75
            {524288.75,                         524289.0},

            {Math.nextDown(twoToThe52),      twoToThe52},
            {twoToThe52,                        twoToThe52},
            {Math.nextUp(twoToThe52),        Math.nextUp(twoToThe52)},

            {Double.MAX_VALUE,          Double.MAX_VALUE},
            {Double.POSITIVE_INFINITY,  Double.POSITIVE_INFINITY},
            {Double.NaN,                        Double.NaN}

        };

        for(int i = 0; i < testCases.length; i++) {
            failures += testRintCase(testCases[i][0], testCases[i][1]);
        }

        // Test values throughout exponent range
        for(double d = Double.MIN_VALUE;
            d < Double.POSITIVE_INFINITY; d *= 2) {
            failures += testRintCase(d, ((d<=0.5)?0.0:d));
        }

        if (failures > 0) {
            System.err.println("Testing {Math, StrictMath}.rint incurred "
                               + failures + " failures.");
            throw new RuntimeException();
        }
    }
}

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

¤ Dauer der Verarbeitung: 0.5 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