Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!apple!usc!snorkelwacker!bloom-beacon!eru!luth!sunic!mcsun!ukc!axion!planet!prk From: prk@planet.bt.co.uk (Peter Knight) Newsgroups: comp.lang.c Subject: Re: Assinging values to type float Message-ID: Date: 29 Aug 90 08:03:35 GMT References: <90240.003415RHMCSUPV@MIAMIU.BITNET> Sender: usenet@planet.bt.co.uk (Usenet News Manager) Organization: RT743, BT Research Labs, Martlesham Heath, Ipswich, UK. Lines: 23 RHMCSUPV@MIAMIU.BITNET (Douglas M. MacFarlane) writes: >Excuse the novice question . . . > >I'm new to C and liking it, but this puzzles me. I'm using Microsoft >C ver 5.1. When I assign a value to a float variable, I get a data- >conversion warning (with warning level 2 set). Why? > >For example: > >float fValue ; /* define fValue as a floating point variable */ > >other lines > >fValue = 35 ; /* produces a Data Conversion warning at compile time */ ^^ This is an integer constant, as it does not of the form 35.0, 35e0 or 3.5e1, etc, which are floating point (actually double) constants. Peter Knight BT Research #include