Karim Belabas on Thu, 17 Nov 2022 23:29:33 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: t_VECSMALL / GEN


* Ruud H.G. van Tol [2022-11-17 13:36]:
> Is this on purpose?
> 
> ? forperm(digits(27,2),p,print(fromdigits(p,2)))
>   ***   at top-level: ...erm(digits(27,2),p,print(fromdigits(p,2)))
>   ***                                             ^-----------------
>   *** fromdigits: incorrect type in fromdigits (t_VECSMALL).
>   ***   Break loop: type 'break' to go back to GP prompt
> break>
> 
> No problem to cast it, but feels unnecessary :)

The function for this existed internally but with a different semantic
(and a bug), so it was actually slightly annoying to implement it.

I commited a patch to the 'master' branch that supports
  fromdigits(t_VECSMALL, b)
also in the case when b < -1 or the vecsmall contains negative integers.
(The internal libpari function assumed b > 1 and handled vecsmall
components as unsigned integers.)

Thanks for your report !

Cheers,

    K.B.
--
Karim Belabas  /  U. Bordeaux,  vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/
`