Newsgroups: comp.os.msdos.djgpp From: Peter Berdeklis Subject: Re: modulus operation with floats requires emulator? Message-ID: Nntp-Posting-Host: chinook.physics.utoronto.ca Sender: news AT info DOT physics DOT utoronto DOT ca (System Administrator) Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Organization: University of Toronto - Dept. of Physics In-Reply-To: <5br7o7$p2e@news1.panix.com> Date: Tue, 21 Jan 1997 01:42:31 GMT References: <5br7o7$p2e AT news1 DOT panix DOT com> Lines: 17 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Sat, 18 Jan 1997, Michael R Weholt wrote: > When I try to use the modulus operation, I can only get it to > work using integers, not floats. When I try it with floats, the > debugger reports: "Error: invalid operands to binary %". I get this ^^^^^^^^ compiler, actually > message even when I try including math.h, or adding the -lm link > option. > > Does this mean I have to get the 387 emulator and use it? This means that the mod operator does not work on floats, with or w/o the emulator. Try the function fmod. --------------- Peter Berdeklis Dept. of Physics, Univ. of Toronto