下面是float类型的一些property .init initializer (NaN) .sizeof size in bytes (equivalent to C's sizeof(type)) .alignof alignment size .infinity infinity value .nan NaN value .dig number of decimal digits of precision .epsilon smallest increment .mant_dig number of bits in mantissa .max_10_exp maximum exponent as power of 10 .max_exp maximum exponent as power of 2 .min_10_exp minimum exponent as power of 10 .min_exp minimum exponent as power of 2 .max largest representable value that's not infinity .min smallest representable value that's not 0 使用方法 bit fun(float r){ return r==float.max; }
D语言的property可以替代traits
最新推荐文章于 2024-01-23 13:42:57 发布