"J.K. Becker" <> wrote in message news:<c5jfaq$reo$>...
> 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?
> If I change the types of the variables I think the result stays the same
> (but I am not 100% sure)...
>
> Jens
Well, you can't actually multiply a double and a float. However, if you
write 0.3 * 0.7f, you will get a float->double conversion, so in fact
you will multiply two doubles. Why don't you add a few lines to your
main printing this? If it fails, remove parts of your program until
it work. If it works, move these test lines closer to your problem area
until it fails.
Regards,
Michiel Salters
|