Live data from Hacker News

Implementing a bignum calculator – Rob Pike [video]

youtube.com

1–10 of 28 posts

Re: Implementing a bignum calculator – Rob Pike [video]

#4
He wants to compute some bignums, so he writes an APL interpreter in Go...

Now he is scratching his itch and making nice slides to boot.

However, it would have been simpler for him to have typed "python" at the commandline... Python ints are arb precision :)

Re: Implementing a bignum calculator – Rob Pike [video]

#5

He wants to compute some bignums, so he writes an APL interpreter in Go... Now he is scratching his itch and making nice slides to boot. However, it would have been simpler for him to have typed "python" at the commandline... Python ints are arb precision :)

> Python ints are arb precision

Python 2 longs or Python 3 ints ;)

Re: Implementing a bignum calculator – Rob Pike [video]

#6

He wants to compute some bignums, so he writes an APL interpreter in Go... Now he is scratching his itch and making nice slides to boot. However, it would have been simpler for him to have typed "python" at the commandline... Python ints are arb precision :)

> Python ints are arb precision Python 2 longs or Python 3 ints ;)

Automatic promotion from a 32-bit or 64-bit storage to arbitrary precision.

Re: Implementing a bignum calculator – Rob Pike [video]

#7

He wants to compute some bignums, so he writes an APL interpreter in Go... Now he is scratching his itch and making nice slides to boot. However, it would have been simpler for him to have typed "python" at the commandline... Python ints are arb precision :)

Lisp would be even better, as he would get the speed of compiled language.

Re: Implementing a bignum calculator – Rob Pike [video]

#8

He wants to compute some bignums, so he writes an APL interpreter in Go... Now he is scratching his itch and making nice slides to boot. However, it would have been simpler for him to have typed "python" at the commandline... Python ints are arb precision :)

Arbitrary precision is handled by https://golang.org/pkg/math/big/

He isn't implementing a bignum package, this is all about the APL interpreter.

Re: Implementing a bignum calculator – Rob Pike [video]

#9

He wants to compute some bignums, so he writes an APL interpreter in Go... Now he is scratching his itch and making nice slides to boot. However, it would have been simpler for him to have typed "python" at the commandline... Python ints are arb precision :)

Yes, but he wasn't trying to compute numbers. He was trying to build a calculator. There's a difference.

Re: Implementing a bignum calculator – Rob Pike [video]

#10

He wants to compute some bignums, so he writes an APL interpreter in Go... Now he is scratching his itch and making nice slides to boot. However, it would have been simpler for him to have typed "python" at the commandline... Python ints are arb precision :)

or GNU CLISP which not only has big ints, big ratios, big complex (like all Common Lisp implementations), but also big floats.

Big ratios:

    [2]> (/ 5723475972349572938475982734985723984759823749587 7239457928374598723984759237459723497598234)
    5723475972349572938475982734985723984759823749587/7239457928374598723984759237459723497598234
Big complex numbers:

    [4]> (* 572934759237495723482374957239475982374957239847523485 (sqrt -1))
    #C(0 572934759237495723482374957239475982374957239847523485)
Big float numbers:

    [8]> (SETF (EXT:LONG-FLOAT-DIGITS) 1000)
    1000
    [9]> (sqrt 2.0l0)
    1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727350138462309122970249248360558507372126441214970999358314132226659275055927557999505011527820605714701095599716059702745345968620147285174186408891986095523292304843087143214508397626036279952514079896872534L0
Post reply on HN