Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Integer overflow in cumprod (cumulative product) output

$
0
0

@1634 wrote:

The cumulative product vector of a series of linear positive numbers (show in plot(cump1) ) contains negative num and zeros(in plot(cump2)). I checked available documentations carefully and still was in dark.

twoNmu=1;ns=Int(1e3)
 cump1=Int64[]
 for i in 0:(ns-1)
  push!(cump1,twoNmu+i)
 end
 #cumpt1=hcat(cump1)
 cump2=cumprod(cump1)#default as one
 plot(cump1)
 plot(cump2)

Posts: 5

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles