G_MINFLOAT definition?



While porting to GObject, we started to make use of the G_MIN and G_MAX
macros as default min/max for object parameters.  For a float parameter,
one would think that the min and max would be +- the largest absolute
value that the type can store, just like for G_MININT and G_MAXINT.
However, this doesn't appear to be the case.  G_MINFLOAT is defined as
FLT_MIN on my machine, which is defined in GCC's float.h as:

   /* Minimum normalised float */
#undef FLT_MIN
#define FLT_MIN 1.17549435e-38F

I don't know what a normalized float is, but it looks a lot like epsilon
to me (but it isn't).

I checked the glib-1.2 documentation, and it simply says that G_MINFLOAT
is "The minimum value which can be held in a gfloat.".

My opinion here is that either the documentation should be changed to
reflect that G_MINFLOAT is not quite what it sounds like, or G_MINFLOAT
really should be -(G_MAXFLOAT).

Thoughts?

      Erik Walthinsen <omega temple-baptist com> - System Administrator
        __
       /  \                GStreamer - The only way to stream!
      |    | M E G A        ***** http://gstreamer.net/ *****
      _\  /_





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]