home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!psinntp!isc-newsserver!gmr6139
- From: gmr6139@ultb.isc.rit.edu (G.M. Richard )
- Subject: Float Variables (was Re: Help!!!...)
- Message-ID: <1992Sep9.134604.16558@ultb.isc.rit.edu>
- Originator: gmr6139@ultb
- Sender: news@ultb.isc.rit.edu (USENET News System)
- Nntp-Posting-Host: ultb-gw.isc.rit.edu
- Organization: Rochester Institute of Technology
- References: <1992Sep8.002536.18118@ultb.isc.rit.edu> <fdhC028W20DL01@JUTS.ccc.amdahl.com>
- Date: Wed, 9 Sep 1992 13:46:04 GMT
- Lines: 43
-
- In article <fdhC028W20DL01@JUTS.ccc.amdahl.com> tpa10@JUTS.ccc.amdahl.com (Thomas P. Anderson) writes:
- >In article <1992Sep8.002536.18118@ultb.isc.rit.edu> gmr6139@ultb.isc.rit.edu (G.M. Richard ) writes:
- >>I can't get my compiler to do float-type variables. I can do
- >>... (some deleted) ... this program with Turbo C, all I get
- >>is zeroes for floats. Take a look:
- >>
- >>/* Variable Example */
- >>#include <stdio.h>
- >>#define apples 4
- >>#define oranges 3.6
- >>main()
- >>{
- >> printf("\nApples = %d\nOranges = %f", apples, oranges);
- >>}
- >>output:
- >>Apples=4
- >>Oranges=0.000000
- >> ... (more deleted)
- >I'm suprised you didn't get any warnings from TC. Try "#include"ing
- >float.h. Also, did you install the floating point libraries, and/or
- >does your link command include them? Just for grins add lines to
- >declare a float variable and try and do some math on it, I bet the
- >linker chokes on you.
- >
- >Tom A.
-
- Thanks for all the responses, mostly through private mail, but I tried
- all the suggestions and none of them worked. I'm not getting any error
- messages, and I have tried using regular floats and math, every which
- way possible, without writing a book. I believe I am using an old
- version (it.s Turbo C, not Turbo C++) but it's all I can fit on my
- computer ('286 w/ 640 k). I'm thinking about actually buying a
- compiler, but when I get a -real- computer, I hope to use Borland C++.
- $80 seems like a waste if I won't use it after one year...
-
- Forever Baffled,
-
-
- --
- _ _ __ gmr6139@ultb.isc.rit.edu
- /| /| __ _/__/_ /__) ' __ /_ __ ,_ __/ gmr6139@george.cs.rit.edu
- / |/ |_/-/__/__/____/ \__/_/___/ /_/-/_/__/_/ gmr6139@ritvax.isc.rit.edu
- ____________________________________________ gmr6139@ritlav.isc.rit.edu
-