FAQ
Hi All,

Is there anyway to represent big digits with multi precision in GO.

Ex: I want to performance all mathematical operations on the below numbers
like A+B , A-B ,A*B ....

A = 123,456,789,012,345,678,901.123
B = 987,654,321,098,765,432,109.876

Thanks and Regards,
Duggineni Haribabu.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Roger peppe at Feb 23, 2015 at 2:33 pm
    See http://golang.org/pkg/math/big


    On 23 February 2015 at 14:26, haribabu duggineni
    wrote:
    Hi All,

    Is there anyway to represent big digits with multi precision in GO.

    Ex: I want to performance all mathematical operations on the below numbers
    like A+B , A-B ,A*B ....

    A = 123,456,789,012,345,678,901.123
    B = 987,654,321,098,765,432,109.876

    Thanks and Regards,
    Duggineni Haribabu.

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Haribabu duggineni at Feb 23, 2015 at 2:39 pm
    Thanks for the response roger peppe. In math package I tried with Big
    integers and It works fine. I want to try the same for Big floats like
    12345678901234567890*.1234*


    On Monday, February 23, 2015 at 5:26:17 PM UTC+3, haribabu duggineni wrote:

    Hi All,

    Is there anyway to represent big digits with multi precision in GO.

    Ex: I want to performance all mathematical operations on the below numbers
    like A+B , A-B ,A*B ....

    A = 123,456,789,012,345,678,901.123
    B = 987,654,321,098,765,432,109.876

    Thanks and Regards,
    Duggineni Haribabu.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ian Lance Taylor at Feb 23, 2015 at 2:48 pm

    On Mon, Feb 23, 2015 at 6:39 AM, haribabu duggineni wrote:

    Thanks for the response roger peppe. In math package I tried with Big
    integers and It works fine. I want to try the same for Big floats like
    12345678901234567890.1234
    On tip the math/big package supports floating point numbers. This
    will be in the future Go 1.5 release. You should be able to copy the
    package out to use it with Go 1.4 under a different name.

    Ian

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Benjamin Measures at Feb 23, 2015 at 4:34 pm

    On Monday, 23 February 2015 14:48:29 UTC, Ian Lance Taylor wrote:
    On Mon, Feb 23, 2015 at 6:39 AM, haribabu duggineni
    <dugginen...@gmail.com <javascript:>> wrote:
    Thanks for the response roger peppe. In math package I tried with Big
    integers and It works fine. I want to try the same for Big floats like
    12345678901234567890.1234
    On tip the math/big package supports floating point numbers.
    Note there's also the Rat type. Where exact representation of rational
    numbers is needed (such as finance), this may be more suitable.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Haribabu duggineni at Feb 23, 2015 at 2:55 pm
    Thanks Ian.

    On Monday, February 23, 2015 at 5:26:17 PM UTC+3, haribabu duggineni wrote:

    Hi All,

    Is there anyway to represent big digits with multi precision in GO.

    Ex: I want to performance all mathematical operations on the below numbers
    like A+B , A-B ,A*B ....

    A = 123,456,789,012,345,678,901.123
    B = 987,654,321,098,765,432,109.876

    Thanks and Regards,
    Duggineni Haribabu.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 23, '15 at 2:26p
activeFeb 23, '15 at 4:34p
posts6
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase