I was writing some code to generate sequence vectors
of the appropriate dimensionality and I ran the following
sequence:

  pdl> $nmax = 1;
  pdl> $nvec = sequence(floor($nmax+1));
  pdl> p $nvec
  0

which surprised me since I expected the result to
be [0,1] since floor($nmax+1) is 2.  It turns out the
result is correct according to the documentation
_since_ the floor() routine generates a pdl output
value even if the input is a perl scalar.  If you use
POSIX::floor instead, I get the expected result:

  pdl> $nvec = sequence(POSIX::floor($nmax+1));
  pdl> p $nvec
  [0 1]

Maybe the PDL::floor routine (and similar routines)
should return perl scalars when passed perl scalars
as input args instead of piddles.  Goes to show
you, PDL can always surprise you!  :-)

--Chris

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to