As Damian checked MSVC++ 6.0 is working fine if you switch on floating point exceptions: _controlfp(0, _MCW_EM );
The problem was in my Beta2 of MSVC 7.0. Any way the class seems to be good solution...
Type: Posts; User: Boris
As Damian checked MSVC++ 6.0 is working fine if you switch on floating point exceptions: _controlfp(0, _MCW_EM );
The problem was in my Beta2 of MSVC 7.0. Any way the class seems to be good solution...
What I found was this:
#include <limits>
numeric_limts<double>::signaling_NaN() is the value of so called "signaling NaN", the only problem is that MS VC++ 6.0/7.0 doesn't support that as it...
It is not true, that the compiler doesn't throw exception if you divide by 0. It throws if you switch on the right floating point exceptions it will do.
_controlfp will let you do this, but that is...
Look, I know how to throw exceptions and how to catch them. What I don't know is how to make compiler turn on floating point exceptions, provided by the hardware. I am absolutely sure for example,...
I have this problem: I want to make my program throw a floating point exceptions when performing operations on invalid floating point numbers:
e.g.
double dNAN;
memset(&dNAN, 0xff, sizeof...
I believe that this is a compiler specific problem, so refer to Borland's news groups:
forums.inprise.com:
borland.public.cpp.borlandcpp
Lets say that base is the same: e.g. so called 'x'
This is a simple class that would give you what you need
class Polynom
{
......
public:
......
double operator () (double x);
...
First about "member": I really do not know. I took the C++ test soon & in this test made 45 right answers (I tried to argue about 3 of the "wrong" answers, but I still didn't receive answer from the...
First of all you do not need all of the variables to be double; but you need "area_forested", "uncut_area" & "forest_rate" of that type. "i" can be (& is better to be) int.
for (double i=1;...
You are absolutely right about IDE. I am using VC++ with Visual Assist too.
What I gave you is just a command line tool which I use to compile small programs to check if they are compiled in...
Oh, yes STL is a standard....
Put on VC++ warings to 4-th level & try to compile program using it, the result is a flow of warings. If this is a standard...
So we both have the conclusion that it...
I am glad to see such responce in that forum.
Your answer is almost perfect.
As you, I haven't read the standard too.
But I am sure standard doesn't tell you the way you should declare the '+'...
class Database
{
//Hope you have a good & fast copy constructor...:
const Database operator+(const Database& rSecond) const
{
Database newDbs;
//Some pseudo code:...
And all of these tons of code for a novice programmer, who doesn't know C++
Good luck, my friend :)
Yes: "Thinking in C++, 2nd ed. Volume 1" by Bruce Eckel, see section: Operator Overloading, '+' operator; see also temporary objects
Now a little example:
struct TheClass
{
....
...
All of the temporary objects are const according to ANSI C++ standard, so this would violate the stanadard, even if possible
What are you trying to achieve?
Maybe this *pointer_to_hitpoints:
int main()
{
int hit_points = 100;
int *pointer_to_hitpoints = & hit_points;
int damage = 10;
int new_hit_points; ...
Please read more before posting here.
A *= B; means: A = A*B
give us a code and we will show you your errors, but again read more, you should understand principles of programming first
Oh, yes, I just copied your code and get rid of reference. Later I saw that, but being const is not a problem, even is better, but operator + should be const I think:
const cp operator + (const...
You have missed a ')':
warm_rate = (pow(warm_coffee + Kelvin),4)-(pow(room_temp + Kelvin),4);
should be:
warm_rate = (pow((warm_coffee + Kelvin),4)-(pow((room_temp + Kelvin),4);
the "http://" button when you want to insert hyperlinks
You should use power, e.g. as in the example 100 acres, rate of 0.5, after X years: 100*(0.5^X): 100*pow(0.5, X), whithout a for loop, or with for loop:
double dAccum = 1;
for (int i = 0; i < X;...
if you are using MS Visual C++ there are a lot of sources for bitmaps in www.codeguru.com
I saw the preview - good work
http://www.ecliptic-entertainment.com/images/Matrix1.gif
Sorry:
sp(const sp& other)
{
m1 = other.m1;
}