|
From: Jack D. <ja...@am...> - 2001-03-06 18:21:13
|
You may have to include the following headers. Try the first one first.
#include <stdlib.h> #include <cmath>
Sometimes compilers do not automatically include the stdlib.h
----- Original Message -----
From: <Rob...@ao...>
To: <dev...@li...>
Sent: Tuesday, March 06, 2001 10:03 AM
Subject: Re: [Dev-C++] float and double
In a message dated 06/03/01 14:33:57 GMT Standard Time,
pet...@im... writes:
<< trav_cost = (km_travelled * 0.3);
wear_cost = ((km_travelled / 1000) - ((km_travelled % 1000) / 100) *
200); >>
I'm not an expert myself - but maybe the compiler is treating 1000, 1000 &
100 as integers as there is no .0 involved? Maybe changing 1000 to 1000.0
and
so on would resolve it? :-)
If not then back to the drawing board I'm afraid :-)
Rob! x ;o)
XANDER: Who's a little fear demon? Come on, who's a little fear demon?
GILES: Don't taunt the fear demon.
XANDER: Why? Can he hurt me?
GILES: No, it's just tacky.
...
GACHNAR: I am the Dark Lord! Fear me!
WILLOW: He’s so cute!
BtVS Season 4 - "Fear, Itself"
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|