Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!umd5!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.unix.wizards Subject: Re: casting to float without converting to float? Message-ID: <6989@brl-smoke.ARPA> Date: 8 Jan 88 06:24:09 GMT References: <11171@brl-adm.ARPA> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 13 In article <11171@brl-adm.ARPA> weiser.pa@Xerox.COM writes: >I would now like to tell the C compiler to treat this thing as a float. C questions should go to comp.lang.c (INFO-C). Try (*(union{int i;float f;})integer).f which should work but probably will give your compiler indigestion. If that doesn't work, store it into such a union's integer member then extract the float member of the union: union {int i; float f} u; u.i = integer; expression( u.f );