|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1218 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 1218.
Report 1218 Actions
Problem Report Number 1218 Submitter's Classification Specification problem State Resolved Resolution Rejected (REJ) Problem Resolution ID REJ.X.0420 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published null Product Standard Internationalised System Calls and Libraries Extended (UNIX 95) Certification Program The Open Brand certification program Test Suite VSU version 4.1.0 Test Identification CAPIbase/ffcvt 1 2 5 Problem Summary PG4U.00047 The test is failing because the interpretation of ndigit is wrong. Problem Text
The test is failing because the interpretation of ndigit is wrong.
We are failing VSU test suite test cases for fcvt() and we think
either the spec is wrong or very ambiguous in it's wording.
We have generally found that our implementation matches other
existing Unix systems:
fcvt(0.01234987, 11) returns "01234598700" and decpt == zero.
The test suite would prefer that we return "1234598700" and a decpt of -1.
ecvt()'s requirements seem to be in conflict with the fcvt() spec:
fcvt()'s ndigit argument specifies the number of digits after the radix point.
In this case ndigit is 11 and we return 11 digits.
ecvt(), however, has a rule that the "...high-order digit is non-zero unless
the value is 0. fcvt(): "Identical to ecvt() except that ndigit specifies
the number of digits desired after the radix point."
I read this as saying that fcvt() would differ from ecvt() where any of
ecvt()'s behaviors would prevent ndigit from specifying the number of
digits desired after the radix point. Since the non-zero leading digit
rule of ecvt() sometimes prevents fcvt() from expressing the correct
number of digits after the decimal point, I would say the two behaviors
are in conflict and that therefore the non-zero rule of ecvt() does not
apply to fcvt().
This may be a test suite error but I'm assuming the test suite
thinks it is correctly testing the spec. Please note that non-zero
rule also affects the 'decpt' returned by fcvt().Test Output
70||"SPEC1170TESTSUITE AREA fcvt 11"
10|778 /tset/CAPIbase/ffcvt/ffcvt1 17:28:49|TC Start, scenario ref 76-42
15|760 1.10 1|TCM Start
400|760 1 1 17:28:52|IC Start
200|760 1 17:28:52|TP Start
520|760 1 9764896 1 1|SPEC1170TESTSUITE CASE 1
520|760 1 9764896 1 2|A call to char *fcvt(double value, int
520|760 1 9764896 1 3|ndigit, int *decpt, int *sign) shall convert value
520|760 1 9764896 1 4|a NULL-terminated string with ndigit digits to the
520|760 1 9764896 1 5|right of the radix point and return a pointer to t
520|760 1 9764896 1 6|string.
520|760 1 31457304 1 1|TEST: fcvt(1.000000, 6) should return "1000000"
520|760 1 31457304 1 2|TEST: fcvt(1290000.000000, 5) should return "1290
520|760 1 31457304 1 3|TEST: fcvt(19.399984, 8) should return "193999837
520|760 1 31457304 1 4|TEST: fcvt(15.499900, 3) should return "15500"
520|760 1 31457304 1 5|TEST: fcvt(-2284.347840, 6) should return "228434
520|760 1 31457304 1 6|TEST: fcvt(-38.293900, 7) should return "38293900
520|760 1 31457304 1 7|TEST: fcvt(-1000.000000, 4) should return "100000
520|760 1 31457304 1 8|TEST: fcvt(123.450000, 10) should return "1234500
520|760 1 31457304 1 9|TEST: fcvt(-123.450000, 3) should return "123450"
520|760 1 31457304 1 10|TEST: fcvt(1.450000, 9) should return "145000000
520|760 1 31457304 1 11|TEST: fcvt(12345.987000, 11) should return "1234
520|760 1 31457304 1 12|TEST: fcvt(0.123460, 11) should return "12345987
520|760 1 31457304 1 13|TEST: fcvt(0.012346, 11) should return "12345987
520|760 1 31457304 1 14|ERROR: fcvt() returned "01234598700"
220|760 1 1 17:28:52|FAIL
410|760 1 1 17:28:53|IC End
80|778 0 17:28:53|TC End
10|779 /tset/CAPIbase/ffcvt/ffcvt2 17:28:53|TC Start, scenario ref 76-42
15|761 1.10 1|TCM Start
400|761 2 1 17:28:56|IC Start
200|761 1 17:28:56|TP Start
520|761 1 9830432 1 1|SPEC1170TESTSUITE CASE 2
520|761 1 9830432 1 2|When value is not 0 the high order digit of the st
520|761 1 9830432 1 3|returned by a call to char *fcvt(double
520|761 1 9830432 1 4|value, int ndigit, int *decpt, int *sign) shall be
520|761 1 9830432 1 5|non-zero.
520|761 1 31522840 1 1|TEST: fcvt(19.399984, 8) should have non-zero ini
520|761 1 31522840 1 2|TEST: fcvt(15.499900, 3) should have non-zero ini
520|761 1 31522840 1 3|TEST: fcvt(-2284.347840, 6) should have non-zero
520|761 1 31522840 1 4|TEST: fcvt(-38.293900, 7) should have non-zero in
520|761 1 31522840 1 5|TEST: fcvt(-1000.000000, 4) should have non-zero
520|761 1 31522840 1 6|TEST: fcvt(123.450000, 10) should have non-zero i
520|761 1 31522840 1 7|TEST: fcvt(-123.450000, 3) should have non-zero i
520|761 1 31522840 1 8|TEST: fcvt(1.450000, 9) should have non-zero init
520|761 1 31522840 1 9|TEST: fcvt(12345.987000, 11) should have non-zero
520|761 1 31522840 1 10|TEST: fcvt(0.123460, 11) should have non-zero in
520|761 1 31522840 1 11|TEST: fcvt(0.012346, 11) should have non-zero in
520|761 1 31522840 1 12|ERROR: The high order digit is incorrect, expect
220|761 1 1 17:28:56|FAIL
410|761 2 1 17:28:56|IC End
80|779 0 17:28:56|TC EndReview Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
We recommend this request be refused.
We believe the ecvt() spec statement that ecvt() returns a pointer
to a NULL terminated string of digits whose...
high-order digit is non-zero, unless the value is 0
clearly applies to fcvt() as well since the spec states that
fcvt() is identical to ecvt() except for the semantics of ndigit.
For ecvt(), ndigits specifies the number of digits contained in
the string of digits.
For fcvt(), ndigits specifies the number of digits desired after
the radix point. So there is no relationship between ndigits and
the number of digits in the string of digits. Since there is no
relationship between these two the string of digits returned by
fcvt() must follow the mandate that the high-order digit of the
string of digits be non-zero.
For the example, fcvt(0.012345987, 11), 11 digits past the radix
point are desired, which would be 0.01234598700.
The mandate that the high-order digit be non-zero still applies
so the leading zeros and period are removed, resulting in the
string, "1234598700", and a decpt value of -1. Taken together
these 2 values properly meet the requirement of 11 digits past
the radix character. There is no requirement that all 11 of
those digits appear in the string.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Rejected (REJ) Review Conclusion
This request is refused.
Problem Reporting System Options:
- View Report 1218
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority