GithubHelp home page GithubHelp logo

Comments (13)

dpsanders avatar dpsanders commented on July 16, 2024

Oops, thanks for catching this. I'll fix tomorrow

from intervalarithmetic.jl.

dpsanders avatar dpsanders commented on July 16, 2024

This just needs a definition of a fallback method
AdjacentFloats.prev_float(x) = prevfloat(x)

from intervalarithmetic.jl.

kalmarek avatar kalmarek commented on July 16, 2024

Thanks. Don't forget to define nextfloat as well ;-)

from intervalarithmetic.jl.

dpsanders avatar dpsanders commented on July 16, 2024

What context did you find this in? Can this be turned into a test case?
These should probably be defined directly in the AdjacentFloats package.

from intervalarithmetic.jl.

JeffreySarnoff avatar JeffreySarnoff commented on July 16, 2024

do you want me to add the fallback for BigFloats into AdjacentFloats?

from intervalarithmetic.jl.

dpsanders avatar dpsanders commented on July 16, 2024

from intervalarithmetic.jl.

JeffreySarnoff avatar JeffreySarnoff commented on July 16, 2024

fixed in master, submitted as new release

from intervalarithmetic.jl.

JeffreySarnoff avatar JeffreySarnoff commented on July 16, 2024

merged

from intervalarithmetic.jl.

kalmarek avatar kalmarek commented on July 16, 2024

I will try to submit a test

from intervalarithmetic.jl.

kalmarek avatar kalmarek commented on July 16, 2024

Ok, test case for this turned out to be easier than expected:

using IntervalArithmetic
setrounding(Interval, :accurate)
w = 0 ± big(0.1)
w*w

(or any function that uses directed in rounding, e.g. :+, :-, :*, :/, :atan2, :^, :sqrt, :inv, :tanh, :asinh, :acosh, :atanh and all of CRlibm)
The catch is it happens only on :accurate rounding and julia-v0.5 does not recompile functions after running setrounding. So an eventual test:

  • would have to start at the beginning of session
  • set rounding before any of these are used
  • run tests caching possible MethodError: no method matching prev_float(::BigFloat)

I didn't look much into tests for Intervals, but how feasible are those conditions?

from intervalarithmetic.jl.

dpsanders avatar dpsanders commented on July 16, 2024

0.5 support has been dropped in the latest version so that is no longer an issue.

It would be great if you could make a pull request with your suggested test code!

from intervalarithmetic.jl.

kalmarek avatar kalmarek commented on July 16, 2024

Should these be placed in IntervalArithmetic.jl/test/interval_tests/rounding.jl ?
since it's the definition of prevfloat, nextfloat should we test all of the functions above, or just + is enough?

from intervalarithmetic.jl.

dpsanders avatar dpsanders commented on July 16, 2024

Fixed upstream in latest release of AdjacentFloats.jl.

from intervalarithmetic.jl.

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.