Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!husc6!cmcl2!brl-adm!adm!anamaria@lll-lcc.llnl.GOV From: anamaria@lll-lcc.llnl.GOV (Ana Maria De Alvare) Newsgroups: comp.unix.wizards Subject: Re: casting to float without converting to float? Message-ID: <11184@brl-adm.ARPA> Date: 8 Jan 88 18:18:45 GMT Sender: news@brl-adm.ARPA Lines: 37 I will consider using the UNION construction. Make a structure that has a union of an int and a float on the same space. That way you can name the same space with two different type. This is also machine dependent in the sense that you need to have the same bit length for both float and int types. Consult Kernigham and Ritchie's C Programming Language book. I have used it for bit and int unions and it makes it easier to manipulate the information. Example: union header { char byt_hdr[2]; struct { unsigned :2, f_dri :1, f_dpi :1, f_dp :1, f_dsn :3, :1, f_revw :3, f_rp :1, f_rsn :3; }flags; }; This will give you the chance of requesting the information on an array of characters or as the bits values itself of that array of character. Really is the word-size I am using on the array of character to retrieve all the bit information and in other parts of the program to manipulate the bits individually. Might sound cumbersome right now, but it does may life easy. See page 139 opn kernigham and Ritchie for more details. Ana Maria