Comments (2)
Interesting idea. I wonder if the problem is not what default representation for real, ie should it be binary or decimal. Note that decimal FP has other issues (e.g. correct rounding I believe is more difficult).
from xl.
I wonder if the problem is not what default representation for real, ie should it be binary or decimal.
I'd definitely go also for decimal FP as I feel it must not be "worse than float". But thinking of it there are at least two ideas to explore:
-
real
could actually be made even closer to mathematical notation used "on a paper" by introducing something like a "variable" decimal FP in a sense that one would choose beforehand how many "true" significant digits incl. zeros (not to be confused with decimal places nor with "usual" significant digits) should be used for output (e.g. a literal1.500
would have 4 significant digits,0001.500
would have 4 significant digits,300
-> 3 sigdigits,0.000100
-> 7 sigdigits) and internally a higher precision would be used to account for few rounding errors whereasfloat
would stay compatible with IEEE 754 and thus support only _Decimal32 _Decimal64 _Decimal128 variants under the hood. -
leave
float
as binary floating point and make onlyreal
into decimal floating point (possibly with the significant digits extension for better user experience and output purposes)
Note that decimal FP has other issues (e.g. correct rounding I believe is more difficult).
Could you be more specific? It still has infinity (actualy many infinities and both negative and positive ones) but otherwise most (if not all) of the issues I know of are basically gone. Actually correct rounding of decimal FP is one of the reasons why decimal FP is being used over binary FP. Feel free to take a look at the "best" library emulating decimal FP to see how rounding is being done (btw. mpdecimal is being used also by Python etc.).
from xl.
Related Issues (20)
- Cleanup the runtime from old / obsolete functions
- Convert XL native modules to XL_NATIVE
- Implement modules
- Error evaluation rules
- Remove remnants of bytecode interpreter (or, alternatively, fix it) HOT 5
- Fast compiler similar to what was used in Tao3D HOT 1
- Improve llvm-crap to deal with deprecated functions in LLVM 9.0.1
- Chat room? HOT 1
- [Comment/Suggestion] The Definition Operator HOT 5
- Conceptual question: how is this language different than other prologs? HOT 1
- Imperative flavour: continue & break in loops HOT 4
- Add to https://github.com/kostya/benchmarks/
- NULL/nil/none/void/... value considered harmful (a "billion dollar mistake" of Tony Hoare) HOT 10
- Nubie feedback - can't build HOT 4
- Can't build native/HelloWorld HOT 3
- Basic Examples Compiler Explanation HOT 1
- Data Inheritance HOT 1
- A small scheme VM HOT 1
- Typo in opcodes.h HOT 1
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 xl.