Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007685OCamlconfigure and build/installpublic2017-12-04 19:302017-12-21 17:43
Reportergrueni 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusconfirmedResolutionopen 
PlatformOpenIndianaOSOpenIndianaOS VersionHipster
Product Version4.06.0 
Target VersionFixed in Version 
Summary0007685: OpenIndiana: failing test float
DescriptionThe test fails because the first letter of the result is capitalized.
Additional Information--- ocaml-4.06.0/testsuite/tests/basic/float.reference.orig 2017-12-04 18:33:56.140895262 +0000
+++ ocaml-4.06.0/testsuite/tests/basic/float.reference 2017-12-04 18:34:06.093706170 +0000
@@ -1 +1 @@
-1./.0. = inf
+1./.0. = Inf
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0018756)
xleroy (administrator)
2017-12-20 17:20

I'm not sure who is wrong: the %f format of OCaml that relies on the C library sprintf() function to print infinities and other special FP values (unless HAS_BROKEN_PRINTF is defined), or the test because it assumes a specific printout for those values. At any rate the problem is not specific to OpenIndiana, it's just triggered by OpenIndiana.
(0018757)
xleroy (administrator)
2017-12-20 17:24

It gets worse. According to C99:

A double argument representing an infinity is converted in one of the styles
[-]inf or [-]infinity — which style is implementation-defined.

So, OpenIndiana's "Inf" is not C99-compliant. But assuming "inf" to be the result of the test is wrong as well...
(0018767)
grueni (reporter)
2017-12-21 17:43
edited on: 2017-12-21 17:45

Maybe a solution is to use a function to test for infinity. This should solve the differences in the implementations.

I have no idea how to do it in ocaml.
In C:
#include <stdio.h>
#include <math.h>

int main()
{
  double a = 1.0/0.0;
  printf("1./.0 = %f\n",a);
  printf("1./.0 = Inf %s\n",isinf(a)?"true":"false");
  return 0;
}

And the reference would be:
1./.0 = Inf true


- Issue History
Date Modified Username Field Change
2017-12-04 19:30 grueni New Issue
2017-12-04 19:53 octachron Summary failing test float => OpenIndiana: failing test float
2017-12-20 17:20 xleroy Note Added: 0018756
2017-12-20 17:20 xleroy Status new => confirmed
2017-12-20 17:24 xleroy Note Added: 0018757
2017-12-21 17:43 grueni Note Added: 0018767
2017-12-21 17:45 grueni Note Edited: 0018767 View Revisions


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker