Comments (5)
So, I think this is a documentation issue.
from astro-float.
@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.
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.
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.
Thanks!
from astro-float.
Related Issues (13)
- Implement ^ operator in expr macro HOT 1
- Proposal for a public `BigFloat::to_f64` HOT 8
- Typedefs Don't Support non-x86 HOT 2
- Values 10x smaller with BigFloat::from_f64(); HOT 1
- `sinh` of a large negative number returns positive infinity HOT 1
- Improve performance of printing and parsing of decimal. HOT 1
- Replace SmallVec with Vec
- Review Unsafe code sections.
- Improve performance of Mantissa::pow_mod HOT 1
- Improve performance of Mantissa::div_short
- Improve performance of Mantissa::mul_short
- Implement AGM algorithms for the logarithm.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astro-float.