Git Product home page Git Product logo

Comments (4)

infradig avatar infradig commented on July 28, 2024

from trealla.

Jean-Luc-Picard-2021 avatar Jean-Luc-Picard-2021 commented on July 28, 2024

GNU Prolog doesn't have bigints. These Prolog systems
cannot realize (^)/2 correctly. You can try yourself the

ISO core standard Prolog flag "bounded", where
"true = no bigints" and "false = bigints":

?- current_prolog_flag(bounded, X).
X = true

Or alternatively you can try:

/* GNU Prolog 1.5.0 */
?- X is 51^20-1.
uncaught exception: error(evaluation_error(int_overflow),(is)/2)

from trealla.

Jean-Luc-Picard-2021 avatar Jean-Luc-Picard-2021 commented on July 28, 2024

Your result is probably a conversion back to integer
from float. To see that you need a precise float to
bigint conversion, which shows me that:

?- X is integer(1.1904242382761301E17).
X = 119042423827613008.

But the computation of a float is not that precise
as the computation of a bigint. Thats where the
precision is lost, and why the integer result shown

is not correct.

from trealla.

Jean-Luc-Picard-2021 avatar Jean-Luc-Picard-2021 commented on July 28, 2024

As already mentioned in another ticket, the error is gone.
For example it is now:

Trealla Prolog (c) Infradig 2020-2022, v2.7.15
?- X is 39^9, Y is 39*39*39*39*39*39*39*39*39.
   X = 208728361158759, Y = X.

Closing this ticket.

from trealla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.