Coder Social home page Coder Social logo

Comments (4)

ThomasLeMezo avatar ThomasLeMezo commented on August 16, 2024

The matter is that python doesn't show all the digits. If you print the lower and upper bound of your interval, you should have correct values

>>> c = pyIbex.exp(Interval(1))
>>> Interval.lb(c)
2.7182818284590433
>>> Interval.ub(c)
2.718281828459048

from pyibex.

oheim avatar oheim commented on August 16, 2024

Yes, as you can see, the interval boundaries cover a different interval than is written in the console. In these examples the intervals are disjoint, but should be subsets. Another example:

>>> 2 * pyIbex.asin(Interval(0, 1))
[0, 3.14159]

The interval covers π internally, which is good, but the output suggests that π is not contained in the interval.

from pyibex.

benEnsta avatar benEnsta commented on August 16, 2024

Thanks for reporting the issue.
I will work on that.

from pyibex.

benEnsta avatar benEnsta commented on August 16, 2024

The method str and repr can be overloaded to show more digits.
For instance with

def myPrint(itv):
    return "[%3.16f, %3.16f]" % (itv.lb(), itv.ub())
Interval.__str__ = myPrint

print(Interval(2.3442, 21.3212) )
>>> [2.3441999999999998, 21.3212000000000010]

from pyibex.

Related Issues (13)

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.