![]() |
![]() |
![]() |
GLib参考手册 | ![]() |
---|---|---|---|---|
Top | Description |
#include <glib.h> #define G_IEEE754_FLOAT_BIAS #define G_IEEE754_DOUBLE_BIAS union GFloatIEEE754; union GDoubleIEEE754; #define G_E #define G_LN2 #define G_LN10 #define G_PI #define G_PI_2 #define G_PI_4 #define G_SQRT2 #define G_LOG_2_BASE_10
GLib提供例如 G_PI 之于 pi 的数学常数; 许多平台都有这些 C 库,但有的平台也不提供,这个 GLib 版本总是有的。
GFloatIEEE754 和 GDoubleIEEE754 联合被用于访问访问标识,IEEE floats 与 doubles的尾数和指数。 这些联合的定义适合某一特定平台。IEEE floats 与 doubles 至少支持(用于存储) Intel,PPC 和 Sparc,参考: http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html
#define G_IEEE754_FLOAT_BIAS (127)
见 http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html
#define G_IEEE754_DOUBLE_BIAS (1023)
见 http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html
union _GFloatIEEE754 { gfloat v_float; struct { guint mantissa : 23; guint biased_exponent : 8; guint sign : 1; } mpn; };
GFloatIEEE754 和 GDoubleIEEE754 联合被用于访问访问标识,IEEE floats 与 doubles的尾数和指数。 这些联合的定义适合某一特定平台。IEEE floats 与 doubles 至少支持(用于存储) Intel,PPC 和 Sparc,参考: http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html
union _GDoubleIEEE754 { gdouble v_double; struct { guint mantissa_low : 32; guint mantissa_high : 20; guint biased_exponent : 11; guint sign : 1; } mpn; };
GFloatIEEE754 和 GDoubleIEEE754 联合被用于访问访问标识,IEEE floats 与 doubles的尾数和指数。 这些联合的定义适合某一特定平台。IEEE floats 与 doubles 至少支持(用于存储) Intel,PPC 和 Sparc,参考: http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html
#define G_LOG_2_BASE_10 (0.30102999566398119521)
Used for fooling around with float formats【这里搞不定。。。。。】, 见 http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html