comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » strange "eq" behaviour
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: strange "eq" behaviour [message #69862 is a reply to message #69770] Mon, 15 February 2010 09:21 Go to previous messageGo to previous message
rogass is currently offline  rogass
Messages: 200
Registered: April 2008
Senior Member
On 15 Feb., 17:18, Spon <christoph.b...@gmail.com> wrote:
> On Feb 15, 3:54 pm, chris <rog...@googlemail.com> wrote:
>
>> Hi David,
>> maxx is the correlation coefficient of some data series. It should be
>> exactly 1 if two data vectors are equal - but it isn't - so now I run
>> into bigger problems with the inbuilt correlate function . Anyway,
>> thanks for your hint.
>
>> CR
>
> Hi David,
>
> 'It should be exactly one' is a tricky statement in floating point
> arithmetic.
> Looks like a good time to trot out this old line again:http://www.dfanning.com/math_tips/sky_is_falling.html
>
> Your specific problem (or something very similar) is dealt with this
> article:http://www.dfanning.com/code_tips/comparearray.html
>
> You might have more success comparing floats using this program:http://www.dfanning.com/programs/floats_equal.pro
>
> Regards,
> Chris

Thank you for enlightening me. MAybe I have to do it in this way:
round(value1*(10^(((pp=precision<lowest_precision_of_both_types)))))
operator round(value1*pp) or I have to use the floats_equal.pro

Thanks and regards

CR
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: strange "eq" behaviour
Next Topic: Re: Segfault when smoothing image

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 08:18:02 PDT 2025

Total time taken to generate the page: 2.60223 seconds