There is also the builtin
http://docs.julialang.org/en/latest/stdlib/numbers/#Base.digits

On Sat, Oct 24, 2015 at 3:51 PM, Tamas Papp <[email protected]> wrote:

> A trivial (but not necessarily the fastest) solution is
>
> function firstdigit(i,base=10)
>     while (i >= base)
>         i = div(i,base)
>     end
>     i
> end
>
> Best,
>
> Tamas
>
> On Sat, Oct 24 2015, paul analyst <[email protected]> wrote:
>
> > How to get first number from Int64
> >
> > julia> lista[3]
> > 464
> >
> > julia> eltype(lista[3])
> > Int64
> >
> > julia> length(lista[3])
> > 1
> >
> > julia> lista[3][]
> > 464
> >
> > julia> lista[3][1]
> >
> > I need the first "4"
> > Paul
>
>

Reply via email to