Re: G_MINFLOAT definition?



On Sun, 17 Jun 2001, Sander Vesik wrote:

> On Sun, 17 Jun 2001, James Henstridge wrote:
> 
> > On Sat, 16 Jun 2001, Erik Walthinsen wrote:
> > 
> > 
> > The documentation should probably say that G_MINFLOAT is a float of the
> > smallest magnitude possible, and have a note about using using -G_MAXFLOAT
> > for the least float.
> > 
> 
> A normalised G_MINFLOAT would not be the smallest possible - there would
> be denormals that are smaller. OTOH, glib probably should not rely on the
> presence of IEEE compiliant floating point nor use denormals if possible.

we do rely in IEEE compliant float/double implementations.

        * glib.h: added GFloatIEEE754 and GDoubleIEEE754 unions to access sign,
        mantissa and exponent of IEEE floats and doubles (required by the new
        version of g_printf_string_upper_bound). the unions are endian specific,
        we handle G_LITTLE_ENDIAN and G_BIG_ENDIAN as of currently. ieee floats
        and doubles are supported (used for storage) by at least intel, ppc and
        sparc, reference:
        http://twister.ou.edu/workshop.docs/common-tools/numerical_comp_guide/ncg_math.doc.html

we've yet to see a machine that glib runs on, that doesn't support
IEEE floats. and if we do, we're in trouble (or at least those machine's
suers ;)

> 
> But the documenattion should say oit is the smallest normalies float if
> that is true.
> 
> > James.
> > 

---
ciaoTJ





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