On Wed, 2014-05-14 at 18:17 +0300, Adrian Dușa wrote: > On Wed, May 14, 2014 at 5:35 PM, Simon Urbanek > <simon.urba...@r-project.org>wrote: > > > [...] > > > > How do you print them? It seems like you're printing 32-bit value instead > > ... (powers of 2 are simply shifts of 1). > > > > > I am simply using Rprintf(): > > long long int power[lgth]; > power[lgth - 1] = 1; > Rprintf("power: %d", power[lgth - 1]); > for (j = 1; j < lgth; j++) { > power[lgth - j - 1] = 2*power[lgth - j]; > Rprintf(", %d", power[lgth - j - 1]); > } > > > Basically, I need them in reversed order (hence the inverse indexing), but > the values are nonetheless the same. > Adrian > > PS: also tried long long int, same result...
Your numbers are being coerced to int when you print them. Try the format ", %lld" instead. Martyn ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel