Re: How to find minimum of two numbers.

From: Mark McIntyre (markmcintyre_at_spamcop.net)
Date: 12/10/04


Date: Fri, 10 Dec 2004 22:35:16 +0000

On Fri, 10 Dec 2004 18:14:30 GMT, in comp.lang.c , "gerard46"
<gerard46@rtt.net> wrote:

>| No, it evaluates to zero.
>| Hint: We are talking about 1/2 == 0 (whereas 1/2.0 or 1.0/2
>| is a completely different matter ;-))
>
>Ah, I see your problem.

actually its /your/ problem... :-)

> You're assumming that I'm using a language that evaluates 1/2 to 0.

In C, this is a perfect assumption.

>Well, mine doesn't. 1/2 = 0.5

You might want consider stopping crossposting to comp.lang.c then, where
integer division cannot result in floating point results.

-- 
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>


Relevant Pages

  • Re: How to find minimum of two numbers.
    ... "Bob Harris" wrote in message ... > Mark McIntyre wrote: ... >> integer division cannot result in floating point results. ... > Well, Mark, then you certainly should stop crossposting to ...
    (comp.lang.c)
  • Re: How to find minimum of two numbers.
    ... Mark McIntyre wrote: ... > integer division cannot result in floating point results. ... Well, Mark, then you certainly should stop crossposting to ...
    (comp.lang.c)
  • Re: Who uses clapack?
    ... This is what I love about usenet. ... "Mark McIntyre" wrote in message ... > can you please stop crossposting to comp.lang.c as this is offtopic here. ... > CLC FAQ ...
    (comp.lang.fortran)
  • Re: Who uses clapack?
    ... This is what I love about usenet. ... "Mark McIntyre" wrote in message ... > can you please stop crossposting to comp.lang.c as this is offtopic here. ... > CLC FAQ ...
    (sci.math.num-analysis)
  • Re: Who uses clapack?
    ... (Victor Eijkhout) ... can you please stop crossposting to comp.lang.c as this is offtopic here. ... Mark McIntyre ... CLC FAQ CLC readme: ...
    (sci.math.num-analysis)