From: <rl...@st...> - 2000-12-06 19:27:54
|
>From ta...@rh... Wed Dec 6 13:23 EST 2000 > >I think a more portable solution is to just make it all an if statement. >I'm not comfortable with presuming that floats are always 4 bytes. I agree -- I also had the thought of changing to an if statement after I sent my mail. Much better than the switch since it can't break. >I've thrown in the int and float cases to make sure we cover every >machine that may be out there. I suspect that if float is 8 bytes then int will be too. Just char, short, float, and double should suffice. If the 4-byte version is missing it will just fall back on the default (slower but otherwise OK), and if the C compiler doesn't support shorter data items then probably the user won't be using them anyway... Rick White |