Search:

Type: Posts; User: Boris

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    5,606

    As Damian checked MSVC++ 6.0 is working fine if...

    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...
  2. Replies
    8
    Views
    5,606

    What I found was this: #include ...

    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...
  3. Replies
    8
    Views
    5,606

    Automatic throw of exceptions

    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...
  4. Replies
    8
    Views
    5,606

    Not what I want

    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,...
  5. Replies
    8
    Views
    5,606

    Floating point exceptions

    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...
  6. Replies
    3
    Views
    1,749

    I believe that this is a compiler specific...

    I believe that this is a compiler specific problem, so refer to Borland's news groups:
    forums.inprise.com:
    borland.public.cpp.borlandcpp
  7. Replies
    23
    Views
    4,565

    Lets say that base is the same: e.g. so called...

    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);
    ...
  8. Replies
    23
    Views
    4,565

    First about "member": I really do not know. I...

    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...
  9. First of all you do not need all of the variables...

    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;...
  10. Replies
    23
    Views
    4,565

    You are absolutely right about IDE. I am using...

    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...
  11. Replies
    23
    Views
    4,565

    Oh, yes STL is a standard.... Put on VC++...

    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...
  12. Replies
    23
    Views
    4,565

    I am glad to see such responce in that forum. ...

    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 '+'...
  13. Replies
    8
    Views
    2,076

    class Database { //Hope you have a good &...

    class Database
    {
    //Hope you have a good & fast copy constructor...:
    const Database operator+(const Database& rSecond) const
    {
    Database newDbs;

    //Some pseudo code:...
  14. Thread: float arrays

    by Boris
    Replies
    10
    Views
    2,262

    And all of these tons of code for a novice...

    And all of these tons of code for a novice programmer, who doesn't know C++
    Good luck, my friend :)
  15. Replies
    23
    Views
    4,565

    Yes: "Thinking in C++, 2nd ed. Volume 1" by Bruce...

    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
    {
    ....
    ...
  16. Replies
    23
    Views
    4,565

    All of the temporary objects are const according...

    All of the temporary objects are const according to ANSI C++ standard, so this would violate the stanadard, even if possible
  17. Thread: Help plz

    by Boris
    Replies
    6
    Views
    1,094

    What are you trying to achieve? Maybe this...

    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; ...
  18. Please read more before posting here. A *= B;...

    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
  19. Replies
    23
    Views
    4,565

    Oh, yes, I just copied your code and get rid of...

    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...
  20. Replies
    2
    Views
    2,415

    You have missed a ')': warm_rate =...

    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);
  21. the "http://" button when you want to insert...

    the "http://" button when you want to insert hyperlinks
  22. You should use power, e.g. as in the example 100...

    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;...
  23. if you are using MS Visual C++ there are a lot of...

    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
  24. http://www.ecliptic-entertainment.com/images/Matri...

    http://www.ecliptic-entertainment.com/images/Matrix1.gif
  25. Replies
    23
    Views
    4,565

    Copy constructor

    Sorry:

    sp(const sp& other)
    {
    m1 = other.m1;
    }
Results 1 to 25 of 43
Page 1 of 2 1 2