Re: Problems with multiplications of doubles and/or floats

From: John Harrison (john_andronicus_at_hotmail.com)
Date: 04/14/04


Date: Wed, 14 Apr 2004 16:26:36 +0100


"J.K. Becker" <jkbecker@becker.de> wrote in message
news:c5jfaq$reo$1@news1.zdv.uni-mainz.de...
> Hi there,
>
> I am trying to multiply doubles with floats (actually I tried every
> possible combination by now) and it never works (well, it does something
> but it is always wrong). I have no idea what it is and where to look for
> help, maybe some of you know?
>
> double=float*double; (or every possible combination of it). An example:
>
> 0.3 * 0.7 would result in 1.7 (with lots more digits). Anyone any idea?

No that is impossible, you have a bug somewhere else in your program. Since
you didn't post the program its impossible to help. Post the code.

What else did you expect, did you think someone would say 'oh yes that's the
well known 0.7 * 0.3 bug, it's been fixed in the new compiler version'?
Compilers do not make basic arithmetic errors. If you want help with a buggy
program you have to post the program code, there is no other way.

See the FAQ http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8

john



Relevant Pages

  • Re: Text box throws an Error 7 Out of Memory with less than 27K in it!
    ... I'd have to agree with Bob here, ... >> those exact numbers and then concatenates that many more, ... I used to work supercomputer compiler support at CDC. ... > My favorite such bug at CDC was a benchmark that ran instantaneously. ...
    (microsoft.public.vb.enterprise)
  • Re: Bug in latest IAR MSP430 compiler optimization???
    ... It has been assigned bug id EW20095, and it will be fixed in the ... The tests compiler companies do are quite extensive. ... register allocation when combined with post-incs and rollup. ... IAR use an industry standard test suite like this (that you don't ...
    (comp.arch.embedded)
  • Re: Salford compiler: Assigning a value to a constant expression is invalid
    ... a bug, it is not usually wise, I think, to assume that it's a compiler bug. ... -|> I'd suggest submitting a self-contained source code file to Salford Support. ... So all I had to do in that case was send the routine and ...
    (comp.lang.fortran)
  • Re: Another computer algebra system : smib
    ... Certainly sometimes a bug is discovered only after a program is ported to a new environment -- a bug that existed in the old environment too, but just had not been exercised. ... Spending time porting a program is ... If the code is a command line drive program, then there should be few differences between for platform A and code for platform B. If one uses portable thread libraries, then if code breaks on platform B, but not on A, I would certainly think it is worth while spending time on platform B to find the problem, as it is highly likely to be a logical error in the program. ... The fact this is new code, I would not release it with over 1600 warnings messages from the compiler. ...
    (sci.math.symbolic)
  • Re: timeouts
    ... If I report a bug in the GCC C compiler, for example, then I can ... Stephen> a support contract for it. ... option when exclusively developing open source software. ...
    (comp.lang.ada)