HomeAbout Us A-Z IndexSearch * Contact Us Register LoginPress Shop

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 2314 Details

Help Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges

This page provides all information on Problem Report 2314.


Report 2314 Actions


    Problem Report Number 2314
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.1196
    Raised 2004-01-27 21:56
    Updated 2004-02-02 20:38
    Published 2004-02-02 20:38
    Product Standard Internationalised System Calls and Libraries Extended V3 (UNIX 03)
    Certification Program The Open Brand certification program
    Test Suite VSX5 version 5.2.4
    Test Identification C99.os/maths/Mremquo/T.remquof 3
    C99.os/maths/remquo-tg/T.remquof 3
    C99.os/maths/remquo/T.remquof 3
    Specification Base Definitions Issue 6
    Location in Spec none
    Linked Problem Reports our, VSX5, Bug, Report, 0021
    Problem Summary double type used in calculations causes incorrect values to be generated.
    Problem Text This failure comes when testing the following xyvalues[][] values in
    remquof.c:

    { (float)INT_MAX, (float)5.123 }

    The code looks like this:

    float x;
    float y;
    float xyquo;
    .
    .
    .
    x = xyvalues[i][0];
    y = xyvalues[i][1];
    dval = remquof(x, y, &quo);
    .
    .
    .
    xyquo = (x - dval) / y;


    Thet float xyquo value that results is unrepresentable. Since fxyquo is
    unrepresentable it cannot be compared to the integer returned from
    remquof().

    Here is a more detailed explanation:

    1. These are the arguments to remquof() --

    x = (float) INT_MAX; <- This is stored in a float as 2147483648.
    y = (float) 5.123; <- This is stored in a float as 5.12300014.

    2. remquof(x, y, &quo) calculates and returns the following two values --

    ret = 0.279605 and quo = 4

    3. xyquo = (fx - ret)/y is calculated --

    xyquo should be (2147483648-.279605)/5.12300014 = 419184772 which quo is
    correctly congruent modulo n to. But this value <419184772> cannot be
    represented exactly as a single-precision floating point number. If you
    try to store this number in a float, it will be represented as
    <419184768>. Since this value is not the correct value to compare quo
    to then the testcase fails.

    A possible solution would be to cast all the values in the division
    calculation to doubles in order to get the correct value. Then the
    testcase passes since a double-precision floating-point number can
    represent 419184772.

    double xyquo;
    xyquo = ((double)x - (double)dval) / (double)y;


    This reported prior to the PR system going online and accepted with the
    following comments. Requesting a TSD until the next version of VSX5 is
    released.

    "Thanks. I have added casts as you suggest, although I used long double
    just in case someone has a compilation environment where int and double
    are the same size.Thanks. I have added casts as you suggest, although I
    used long double just in case someone has a compilation environment
    where int and double are the same size."
    Test Output ************************************************************************
    /tset/C99.os/maths/Mremquo/T.remquof 3 Failed

    Test Description:
    remquof stores a value whose sign is the sign of x/y and whose
    magnitude is congruent modulo pow(2, n) to the integral quotient of
    x/y, where n is an implementation defined integer equal to or
    greater

    Test Strategy:
    CALCULATE floating point constants using mlmachar().
    CREATE child
    FOR various values of x and y:
    CALL remquof(x, y, quo).
    VERIFY that *quo has the same sign as x/y.
    VERIFY that abs(*quo) is congruent modulo pow(2, n) to the
    magnitude of the true quotient.

    Test Information:
    remquof(2.14748e+09, 5.123, &quo) set quo to 4
    and 4 is not congruent modulo pow(2, n) to 419184768


    ************************************************************************
    ************************************************************************
    /tset/C99.os/maths/remquo-tg/T.remquof 3 Failed

    Test Description:
    remquof stores a value whose sign is the sign of x/y and whose
    magnitude is congruent modulo pow(2, n) to the integral quotient of
    x/y, where n is an implementation defined integer equal to or
    greater
    than three.

    Test Strategy:
    CALCULATE floating point constants using mlmachar().
    CREATE child
    FOR various values of x and y:
    CALL remquo(x, y, quo).
    VERIFY that *quo has the same sign as x/y.
    VERIFY that abs(*quo) is congruent modulo pow(2, n) to the
    magnitude of the true quotient.

    Test Information:
    remquo(2.14748e+09, 5.123, &quo) set quo to 4
    and 4 is not congruent modulo pow(2, n) to 419184768


    ************************************************************************
    ************************************************************************
    /tset/C99.os/maths/remquo/T.remquof 3 Failed

    Test Description:
    remquof stores a value whose sign is the sign of x/y and whose
    magnitude is congruent modulo pow(2, n) to the integral quotient of
    x/y, where n is an implementation defined integer equal to or
    greater
    than three.

    Test Strategy:
    CALCULATE floating point constants using mlmachar().
    CREATE child
    FOR various values of x and y:
    CALL remquof(x, y, quo).
    VERIFY that *quo has the same sign as x/y.
    VERIFY that abs(*quo) is congruent modulo pow(2, n) to the
    magnitude of the true quotient.

    Test Information:
    remquof(2.14748e+09, 5.123, &quo) set quo to 4
    and 4 is not congruent modulo pow(2, n) to 419184768


    ************************************************************************

    Review Information

    Review Type TSMA Review
    Start Date 2004-01-27 21:56
    Last Updated 2004-02-02 20:14
    Completed 2004-02-02 20:14
    Status Complete
    Review Recommendation Test Suite Deficiency (TSD)
    Review Response This is accepted as a fault in the test suite.

    Review Type SA Review
    Start Date 2004-02-02 20:14
    Last Updated 2004-02-02 20:38
    Completed 2004-02-02 20:38
    Status Complete
    Review Resolution Test Suite Deficiency (TSD)
    Review Conclusion A test suite deficiency is granted.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority