Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site usceast.UUCP Path: utzoo!watmath!clyde!burl!ulysses!harpo!decvax!mcnc!ncsu!ncrcae!usceast!ted From: ted@usceast.UUCP (Ted Nolan) Newsgroups: net.unix Subject: Re: Converting floats to ascii and vice versa Message-ID: <2036@usceast.UUCP> Date: Tue, 1-May-84 12:28:47 EDT Article-I.D.: usceast.2036 Posted: Tue May 1 12:28:47 1984 Date-Received: Wed, 2-May-84 06:38:47 EDT References: <148@sri-arpa.UUCP> Organization: Csci Dept, U of S. Carolina, Columbia Lines: 17 <1 = 0.99999999> There are several ways to convert floats to ascii and vice versa. The query asked specifically (sp?) for functions like atoi and itoa. Our version 7 system has an atof(3) function available, which is like atoi for floats. If this is not present K&R give an atof function on page 69 of the C book . However, I find that the string formatting commands sprintf and sscanf give a much nicer and more general way to do this type of conversion -- -------------------------------------------------------------------------------- Ted Nolan usceast!ted 6536 Brookside Circle Columbia, SC 29206 (feather the rast!) --------------------------------------------------------------------------------