Coder Social home page Coder Social logo

Comments (5)

stencillogic avatar stencillogic commented on May 27, 2024 1

So, I think this is a documentation issue.

from astro-float.

stencillogic avatar stencillogic commented on May 27, 2024 1

@barafael As a follow up, it appears that potentially any BigFloat marked as inexact when passed as input to not only expr!, but also to some functions, e.g. acos can potentially hang the computation. So, I am going to change the behaviour of such functions and the macro expr! in such way that they will treat any argument of type BigFloat as exact. I think it will be less confusing and less error prone. Thank you for pointing to this problem.

from astro-float.

stencillogic avatar stencillogic commented on May 27, 2024

In your example numbers are constructed from raw parts, and both of them are inexact (last argument in BigFloat::from_raw_parts). As a result, when two inexact numbers are added, the result is also inexact. That means that expr! will try to achieve correct rounding by increasing the precision of the result until the least significant bit flips, which will never happen in this example. So, either the numbers should be marked as exact (BigFloat::set_inexact), or the rounding mode could be None if you don't care about correct rounding (a correctly rounded result differs just in the least significant bit).
Unfortunately, expr is not intelligent and does not analyze the expression you give it, so this kind of situation can happen.

from astro-float.

stencillogic avatar stencillogic commented on May 27, 2024

Release 0.8.0 has been published that should cover this problem. More specifically: mechanism of correct rounding has been removed from the expr! macro completely.
Release notes https://github.com/stencillogic/astro-float/blob/main/RELEASE_NOTES.md

from astro-float.

barafael avatar barafael commented on May 27, 2024

Thanks!

from astro-float.

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.