linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gcc: Floating point exception
@ 2005-02-20 20:58 J.
  2005-02-20 21:05 ` Jan-Benedict Glaw
  0 siblings, 1 reply; 3+ messages in thread
From: J. @ 2005-02-20 20:58 UTC (permalink / raw)
  To: linux-c-programming

Sunday, February 20 21:50:07

Hello,

When I compile the following 5lines of code with `gcc -Wall -pedantic', I
get no warnings or any errors. However when I run the compiled
program I get the error: Floating point exception .

Anyone knows what I should fix ? I already tryd the different
storage types float, etc.. But then gcc complains  warning: long int
format, int arg... etc... ?

I am using gcc version: 2.95.4

#include <stdio.h>

int main(void) {
 int red = 0; 
 int green = 128; 
 int blue = 0;

 printf("%d %d %d\n", (100 / (256 / red)), 
   (100 / (256 / green)), (100 / (256 / blue)));

 return 0;
}

Thnkx.. J.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-02-20 21:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-20 20:58 gcc: Floating point exception J.
2005-02-20 21:05 ` Jan-Benedict Glaw
2005-02-20 21:13   ` J.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).