Path: utzoo!censor!becker!bdb From: bdb@becker.UUCP (Bruce Becker) Newsgroups: comp.sys.amiga Subject: Re: Manx and floats Message-ID: <444@becker.UUCP> Date: 24 Apr 89 03:54:26 GMT References: <5135@hubcap.clemson.edu> Reply-To: bdb@becker.UUCP (Bruce Becker) Distribution: na Organization: G. T. S., Toronto, Ontario Lines: 28 In article <5135@hubcap.clemson.edu> disd@hubcap.clemson.edu (BJ Backitis) writes: | [...] |sscanf(text,"%f",&number); | |I compiled the program using either one of the +f flags and linked using |the following: | |ln -g [.o files here] -larp -l["appropriate" math lib here] -lc | |Now according to SDB, text is indeed " 2.78 \n", but number does not get |converted to the floating point equivalent. I played around with sscanf |a little using an integer variable just to see if sscanf would work with |ints. (SDB makes for a wonderful C interpreter. :-) It converted text |to 2 and stored it in the int variable just so. So sscanf works as |advertised, but something needed for proper float use is missing. The Manx docs are a little disordered, but the info is in there somewhere. What you need to do is add "-lm" *before* the "-lc" on the link command. This brings in versions of printf/scanf from the math library which support floating point... Cheers, -- __ Bruce Becker Toronto, Ont. w \cc/ Internet: bdb@becker.UUCP, bruce@gpu.utcs.toronto.edu `/v/-e BitNet: BECKER@HUMBER.BITNET _< >_ "A divine sparc turned me from nextrophilia" - NoNuke of the North