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

Home » Public Forums » archive » Strange behavior of /cumulative keyword in total()
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Strange behavior of /cumulative keyword in total() [message #63296] Tue, 04 November 2008 02:10
Chris[5] is currently offline  Chris[5]
Messages: 16
Registered: May 2008
Junior Member
Can anybody explain this?

arr = fltarr( 500000) + .1
cumul = total(array, /cumulative)

print, (cumul - shift(cumul, 1)) [1 : 10]
print, (cumul - shift(cumul,1)) [499990:499999]

> 0.100000 0.100000 0.100000 0.100000 0.100000 0.100000
0.100000 0.100000 0.100000 0.100000


> 0.101562 0.101562 0.101562 0.101562 0.101562 0.101562
0.101562 0.101562 0.101562 0.101562

Plotting cumul - shift(cumul,1) is even weirder. I can understand the
net error of cumul growing over time, as floating point precision
errors accumulate. However, shouldn't the error between any two
entries in a cumulative sum not accumulate over the array?


chris
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Coyote as Mac User
Next Topic: IDL hilbert() function

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

Current Time: Wed Oct 08 15:40:09 PDT 2025

Total time taken to generate the page: 0.00468 seconds