Max Alekseyev on Thu, 27 Sep 2007 22:47:27 +0200


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

Re: Pari get digit method?


Would x%10 work for you (where x is given number)?
It is based on the observation that the last decimal digit of the
number x equal to the remainder of division of x by 10.

Regards,
Max

On 9/27/07, Lonnie Cumberland <lonnie@outstep.com> wrote:
> Greetings all,
>
> I am still a little new to using Pari and need to write a small script
> that will allow me to make an integer calculation after which I need
> to get the value of the last digit in the number so that I can take an
> action based upon that value which would be between 0 and 9.
>
> Does someone know how I might be able to do this?
>
> I would like to use a switch-case to take action based upon the value.
>
> Sincerely and have a great day,
> Lonnie T. Cumberland
>
> Email: Lonnie@outstep.com
>        Lonnie_Cumberland@yahoo.com
>        Lonnie.Cumberland@gmail.com
>
> "Helping to improve our communities, one by one......"
>
>
>
>