LLACROIX@carleton.EDU (Les LaCroix) (06/01/88)
I am using VAX C 2.3 and VMS 4.7. (VAX C 2.4 is here, and it does not address my problem, either.) Module 'float' in VAXCDEF.TLB contains macros described in the ANSI C draft. Many of the values are incorrect, especially the minimum, maximum and machine epsilon values. I am also dubious about the xxx_MANT_DIG symbols (for instance, FLT_MANT_DIG is 23 but a 'float' datum has "a normalized 24-bit fraction with the redundant most significant fraction bit not represented" (VAX Architecture Handbook, 1981). Further, none of the values vary depending on whether or not /G_FLOAT is used during compilation (which should change most of the DBL_xxxx macros). I have a version of float.h with definitions which expand to expressions with correct, _exact_ D_float values of DBL_MIN, DBL_MAX and DBL_EPSILON. (I have no need for the other macros at this time.) I would like to hear from anyone who has made corrections to this header, to discuss values and strategies. Then (if it hasn't already happened) I will post a version of float.h to the net which has some corrected values. Les LaCroix SPSS Inc, 402 Washington, Northfield MN USA 55057-2027 tel 507/663-1205 lacroix%spssnf@carleton.edu (CSnet) lacroix%spssnf.carleton.edu@relay.cs.net (BITNET) [(standard disclaimer) I do not represent my employer in this note.]
JOE@FHCRCVAX.BITNET (Joe Meadows) (06/14/88)
>> I am using VAX C 2.3 and VMS 4.7. (VAX C 2.4 is here, and it does not >> address my problem, either.) Module 'float' in VAXCDEF.TLB contains macros >> described in the ANSI C draft. Many of the values are incorrect, >> especially the minimum, maximum and machine epsilon values. I am also >> dubious about the xxx_MANT_DIG symbols (for instance, FLT_MANT_DIG is 23 >> but a 'float' datum has "a normalized 24-bit fraction with the redundant >> most significant fraction bit not represented" (VAX Architecture Handbook, >> 1981). Further, none of the values vary depending on whether or not >> /G_FLOAT is used during compilation (which should change most of the >> DBL_xxxx macros). >I would just like to note that the V2.3 header files are FULL of errors like >this. <smgdef.h> and <stdlib.h> contained syntax errors, NULL is defined >differently in different headers, <limits.h> has wrong values for *_MIN, and ><string.h> has a number of functions misdeclared. I wrote a program (UNSDL) that takes DEC's standard symbol definition files, and create (mostly) correct header files. At least, it can certainly get smgdef.h and the likes correctly. However, it doesn't handle the cases of G. vs. D. floating points very well. Actually, it handles them exactly the way a similar program by DEC does. If someone would like to improve on my work, by putting in proper ifdef's and such, please feel free. My program will create proper prototypes as well (i.e. I created a STARLET.H which includes all the system services). Again, with some of the math functions, the case of G float is not really handled. Even in DEC's symbol definition files some things are wrong, there are about 5 lib$ routines that are improperly declared.. None the less, all of the STARLET modules appear correct (they'd better be, they are used to create the Macro and Bliss files). If you'd like a copy, let me know (it's called UNSDL), and I'll send you one. If you add the G-float stuff, I'd be estatic to hear about it and get a copy. Cheers, Joe Meadows joe@fhcrcvax.bitnet