FAQ
Hello, all.


Can somebody help me to understand if I have encountered a bug in math/big
library or not?


http://play.golang.org/p/QVWwgKMdCu
I expect the result to be equal zero, but I see it equal M.


It happens only for when x, y are really big.


I am on:

go version go1.5.1 darwin/amd64

*OS X 10.9.5: *Darwin t2.local 13.4.0 Darwin Kernel Version 13.4.0: Wed Mar
18 16:20:14 PDT 2015; root:xnu-2422.115.14~1/RELEASE_X86_64 x86_64

--
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

  • Alb Donizetti at Jan 11, 2016 at 5:13 pm
    Yep, that's a bug. See https://github.com/golang/go/issues/13907

    Il giorno lunedì 11 gennaio 2016 18:03:41 UTC+1, Yury Smolsky ha scritto:
    Hello, all.


    Can somebody help me to understand if I have encountered a bug in math/big
    library or not?


    http://play.golang.org/p/QVWwgKMdCu
    I expect the result to be equal zero, but I see it equal M.


    It happens only for when x, y are really big.


    I am on:

    go version go1.5.1 darwin/amd64

    *OS X 10.9.5: *Darwin t2.local 13.4.0 Darwin Kernel Version 13.4.0: Wed
    Mar 18 16:20:14 PDT 2015; root:xnu-2422.115.14~1/RELEASE_X86_64 x86_64
    --
    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.
  • Damian Gryski at Jan 11, 2016 at 8:28 pm

    On Monday, January 11, 2016 at 6:14:04 PM UTC+1, alb.do...@gmail.com wrote:
    Yep, that's a bug. See https://github.com/golang/go/issues/13907
    I had mentioned a while ago on Twitter how interesting it would be to use a
    bunch of the major bigint libraries to cross-check eachother. A
    combination of fuzzing (to generate inputs with good coverage) and
    verifying the results match between Go, gmp, OpenSSL, etc...

    Damian

    --
    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.
  • Nick Craig-Wood at Jan 12, 2016 at 11:10 am

    On 11/01/16 20:28, Damian Gryski wrote:
    On Monday, January 11, 2016 at 6:14:04 PM UTC+1, alb.do...@gmail.com wrote:

    Yep, that's a bug. See https://github.com/golang/go/issues/13907
    <https://github.com/golang/go/issues/13907>


    I had mentioned a while ago on Twitter how interesting it would be to
    use a bunch of the major bigint libraries to cross-check eachother. A
    combination of fuzzing (to generate inputs with good coverage) and
    verifying the results match between Go, gmp, OpenSSL, etc...
    That is a really good idea.

    Though I'm reminded of Knuth talking about generating test cases for
    Algorithm D (long division) in The Art of Computer Programming Vol 2
    "Seminumerical Algorithms" and about how unlikely some of the code paths
    are and how difficult it is to generate test data for them, so you might
    be waiting a very long time for fuzzing to cover the code. (Sorry don't
    have the book to hand for a more accurate reference.)

    --
    Nick Craig-Wood <nick@craig-wood.com> -- http://www.craig-wood.com/nick

    --
    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.
  • Jesper Louis Andersen at Jan 12, 2016 at 1:23 pm

    On Mon, Jan 11, 2016 at 9:28 PM, Damian Gryski wrote:

    I had mentioned a while ago on Twitter how interesting it would be to use
    a bunch of the major bigint libraries to cross-check eachother. A
    combination of fuzzing (to generate inputs with good coverage) and
    verifying the results match between Go, gmp, OpenSSL, etc...

    A classic use of 'testing/quick' !

    In QuickCheck-like libraries a common method is to write a simple,
    slow-but-correct variant of an advanced algorithm and then use samples from
    a "good" random input distribution to cover a more advanced algorithm and
    check for similarity in output. But if you have several systems, you can
    match them against each other as well.

    A more ambitious project merges the idea of profile-guided-fuzzing as in
    Vyukov's go-fuzz of AFL fame by generating inputs which makes the coverage
    in the profile better. An even more ambitious solution attaches a SMT
    solver, such as Z3, to the fuzzer in order to quickly define input classes
    and kill redundant cases from the test space. This is known as 'concolic
    testing' (concolic being a Jabberwockyification of concrete and symbolic).

    There is a C tool called CUTE for concolic testing of C, IIRC.

    --
    J.

    --
    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
postedJan 11, '16 at 5:03p
activeJan 12, '16 at 1:23p
posts5
users5
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase