Re: [ROOT] tiny Bug in root

From: Stelios Kesisoglou (kesisogl@fnal.gov)
Date: Thu Nov 29 2001 - 18:43:24 MET


Hi Aidong,

    Yes I have noticed this problem also myself.

    I understand why ROOT returns this result.

    First it calculates the sin(x) for x=0.0 and finds it 0.0

    Then attempts to calculate 1/x for x=0.0 and it sets this result
to the maximum number that can be represented internaly.

    Then performs the multiplication and the result is zero.

    Now how this can be fixed?
    In your code probably by setting x to be very small like 1.0e-15.
    On ROOT I don't know.

Stelios.
----------------------------------------------------------------------------
------

----- Original Message -----
From: "Aidong Chen" <chenad@SLAC.stanford.edu>
To: <roottalk@pcroot.cern.ch>
Sent: Thursday, November 29, 2001 9:57 AM
Subject: [ROOT] tiny Bug in root


> Dear ROOTERs,
>
> I have a test on the following code:
>
> TF1 f1("func1", "sin(x)/x", 0, 10)
> f1.Eval(0),
>
>
> It gives the value 0 instead of 1.
>
> I am using root Version   3.01/06 , released at 23 July 2001.
>
> Thank you for your attention.
>
> Aidong
>
>



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:10 MET