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

Home » Public Forums » archive » Incrementing an element multiple times without a loop?
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: Incrementing an element multiple times without a loop? [message #88441 is a reply to message #88440] Fri, 25 April 2014 08:00 Go to previous messageGo to previous message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Friday, April 25, 2014 4:50:24 PM UTC+2, timbo...@gmail.com wrote:
>
> For example a = [0,0,0], b=[1,1,2], the result should be [0,2,1]
>
> Simply using a[b]+=1 only increments the each unique element in b once and would give [0,1,1]
>

++a[b]

(a[b]+=1 and a[b]++ give different results, I don't know whether this is good or bad :-)

regards,
Lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: H5D_Read on compound type (GDL)
Next Topic: Problem reading HDF5

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

Current Time: Wed Oct 08 20:05:23 PDT 2025

Total time taken to generate the page: 0.00450 seconds