Bil Kleb wrote:
> 
> These could be detected and the Float class constants
> depreciated (simply not set?) accordingly.

Done; attached is the proposed patch.

Whad'da think?

Note: this was only checked by "Gurus scan the code" and an
irb "Guru" check of all the numbers.  To be complete, i.e.,
maintainable, it would require adding appropriate Rubicon tests.

--
Bil K (and Bill W)
NASA Langley Research Center
Hampton, Virginia, USA

% cvs diff -c
Index: configure.in
===================================================================
RCS file: /src/ruby/configure.in,v
retrieving revision 1.108
diff -c -r1.108 configure.in
*** configure.in        2002/01/29 09:15:59     1.108
--- configure.in        2002/02/01 17:04:42
***************
*** 273,279 ****
  AC_HEADER_DIRENT
  AC_HEADER_STDC
  AC_HEADER_SYS_WAIT
! AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h\
                 fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
                 syscall.h pwd.h a.out.h utime.h memory.h direct.h sys/resource.h \
                 sys/mkdev.h)
--- 273,279 ----
  AC_HEADER_DIRENT
  AC_HEADER_STDC
  AC_HEADER_SYS_WAIT
! AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h float.h sys/file.h sys/ioctl.h\
                 fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
                 syscall.h pwd.h a.out.h utime.h memory.h direct.h sys/resource.h \
                 sys/mkdev.h)
Index: numeric.c
===================================================================
RCS file: /src/ruby/numeric.c,v
retrieving revision 1.38
diff -c -r1.38 numeric.c
*** numeric.c   2002/01/11 09:18:50     1.38
--- numeric.c   2002/02/01 17:04:43
***************
*** 13,18 ****
--- 13,21 ----
  #include "ruby.h"
  #include <math.h>
  #include <stdio.h>
+ #ifdef HAVE_FLOAT_H
+ #include <float.h>
+ #endif
  #if defined(__FreeBSD__) && __FreeBSD__ < 4
  #include <floatingpoint.h>
  #endif
***************
*** 1669,1674 ****
--- 1672,1718 ----

      rb_define_singleton_method(rb_cFloat, "induced_from", rb_flo_induced_from, 1);
      rb_include_module(rb_cFloat, rb_mPrecision);
+
+ #ifdef HAVE_FLOAT_H
+     rb_define_const(rb_cFloat, "FLT_ROUNDS", INT2FIX(FLT_ROUNDS));
+     rb_define_const(rb_cFloat, "FLT_RADIX", INT2FIX(FLT_RADIX));
+
+     rb_define_const(rb_cFloat, "FLT_MANT_DIG", INT2FIX(FLT_MANT_DIG));
+     rb_define_const(rb_cFloat, "DBL_MANT_DIG", INT2FIX(DBL_MANT_DIG));
+     rb_define_const(rb_cFloat, "LDBL_MANT_DIG", INT2FIX(LDBL_MANT_DIG));
+
+     rb_define_const(rb_cFloat, "FLT_DIG", INT2FIX(FLT_DIG));
+     rb_define_const(rb_cFloat, "DBL_DIG", INT2FIX(DBL_DIG));
+     rb_define_const(rb_cFloat, "LDBL_DIG", INT2FIX(LDBL_DIG));
+
+     rb_define_const(rb_cFloat, "FLT_MIN_EXP", INT2FIX(FLT_MIN_EXP));
+     rb_define_const(rb_cFloat, "DBL_MIN_EXP", INT2FIX(DBL_MIN_EXP));
+     rb_define_const(rb_cFloat, "LDBL_MIN_EXP", INT2FIX(LDBL_MIN_EXP));
+
+     rb_define_const(rb_cFloat, "FLT_MAX_EXP", INT2FIX(FLT_MAX_EXP));
+     rb_define_const(rb_cFloat, "DBL_MAX_EXP", INT2FIX(DBL_MAX_EXP));
+     rb_define_const(rb_cFloat, "LDBL_MAX_EXP", INT2FIX(LDBL_MAX_EXP));
+
+     rb_define_const(rb_cFloat, "FLT_MIN_10_EXP", INT2FIX(FLT_MIN_10_EXP));
+     rb_define_const(rb_cFloat, "DBL_MIN_10_EXP", INT2FIX(DBL_MIN_10_EXP));
+     rb_define_const(rb_cFloat, "LDBL_MIN_10_EXP", INT2FIX(LDBL_MIN_10_EXP));
+
+     rb_define_const(rb_cFloat, "FLT_MAX_10_EXP", INT2FIX(FLT_MAX_10_EXP));
+     rb_define_const(rb_cFloat, "DBL_MAX_10_EXP", INT2FIX(DBL_MAX_10_EXP));
+     rb_define_const(rb_cFloat, "LDBL_MAX_10_EXP", INT2FIX(LDBL_MAX_10_EXP));
+
+     rb_define_const(rb_cFloat, "FLT_MIN", rb_float_new(FLT_MIN));
+     rb_define_const(rb_cFloat, "DBL_MIN", rb_float_new(DBL_MIN));
+     rb_define_const(rb_cFloat, "LDBL_MIN", rb_float_new(LDBL_MIN));
+
+     rb_define_const(rb_cFloat, "FLT_MAX", rb_float_new(FLT_MAX));
+     rb_define_const(rb_cFloat, "DBL_MAX", rb_float_new(DBL_MAX));
+     rb_define_const(rb_cFloat, "LDBL_MAX", rb_float_new(LDBL_MAX));
+
+     rb_define_const(rb_cFloat, "FLT_EPSILON", rb_float_new(FLT_EPSILON));
+     rb_define_const(rb_cFloat, "DBL_EPSILON", rb_float_new(DBL_EPSILON));
+     rb_define_const(rb_cFloat, "LDBL_EPSILON", rb_float_new(LDBL_EPSILON));
+ #endif

      rb_define_method(rb_cFloat, "to_s", flo_to_s, 0);
      rb_define_method(rb_cFloat, "coerce", flo_coerce, 1);