Re: [GD-General] The joy of type aliasing and C
Brought to you by:
vexxed72
From: Alen L. <ale...@cr...> - 2003-12-31 11:16:06
|
>> Generally, trying to look at a float as if it's some kind of a >> black box that stores real numbers, is kinda silly. >I think this depends entirely on the application's domain. A lot of >applications will merrily use a float and perform floating point >operations and have no care at all whether the underlying >implementation is IEEE-754 or some freakish VAX implementation. True, but I happen to work in such domain that just I have to care. But I guess we all do. ;) >You can inspect an implementation's internal representation by using ><float.h> and inspecting the associated predefined constants. These <...> I am aware of that, but I don't find it particularly useful, except for stuff like: assert(FLT_MANT_DIG>=24). Honestly, have you ever made an app that dynamically adjust itself depending on number of bits in mantissa? Most code I see uses things like typedef int INT32; and adjusts it with #ifs for different platforms. Not to say that a generic int shouldn't be available, for people that want it, but for sanity sake, standards could just add int16, int32 etc. and get over with the mess. Am I wrong? Alen |