Comments (9)
This is mostly implemented, although the docs should explain the workings some more.
Edit 2021: I actually don't think this is true.
from sparqlee.
@rubensworks This issue shouldn't be closed. We still need to make sure the cast from decimal is performed. #103 (comment)
from sparqlee.
If we wish to implement type promotion
completely, we should make sure we cast the decimal to double or float when promoting decimal.
from sparqlee.
I think this issue is bigger then it seems. If I understand the xsd specs correct, decimal shouldn't have any precision. This is not the case yet. I think #45 is the issue related to this. We already use non precision bound decimals in function by using Decimal.js
, introduced in #44 . To be spec compliant we should extend this use. A DecimalLiteral
should not hold the typedValue
with a number type since number is actually a double. We should make DecimalLiteral
hold a string value instead.
If we do that, this issue is a bit closer to being closed. We should then split the parseXSDFloat
function from lib/util/Parsing.ts
. into parseXSDFloat
and parseXSDDouble
. In which case the parseXSDFloat
function should also check if the value is a valid IEEE single-precision 32-bit floating point like mentioned in the specs.
I think this would solve both #44 and this issue.
from sparqlee.
You are right in asserting that #45 is a prerequisite for doing numerics entirely correct, i.e. by giving decimals infinite precision. However, I think the issue of type promotion can be considered separate: we can start by making sure it works on a type level (e.g. a decimal can be used when a function expects a float).
The actual specific numeric behavior is imo less important now and can fixed later.
from sparqlee.
That part of type promotion already works. I just read that type promotion on a decimal could have a loss of precision and wanted to be sure this happens. That's why this issue is still open. But it seems like we have this loss of precision anyway because we don't represent decimals like we should.
from sparqlee.
Yes. Precision & ranges are currently not handled correctly at all and should be for another issue. So I guess we can close this?
from sparqlee.
We could but we shouldn't forget to handle it in the overloadTree when we implement precision correctly.
from sparqlee.
Ofcourse, I will repurpose #45 to talk about precision more broadly.
from sparqlee.
Related Issues (20)
- Auto casting arguments using `OverloadTree` HOT 26
- Document spec link explaining `arithmeticWidening` HOT 1
- Clean NumericLiterals specificFormatterCreator HOT 1
- OverloadTree caching and open world types HOT 2
- Async super type discovery and getting full context in regular functions. HOT 1
- Wrong implementation of substr HOT 3
- Handle invalid lexical form better HOT 6
- Make new type system default HOT 1
- Breaking changes HOT 9
- Dependency Dashboard
- Include Sparqlee into the main Comunica monorepo HOT 15
- DISTINCT is not supported yet on aggregates
- `month` function not erroring on invalid dates HOT 1
- Integrate expression handling into comunica's bus system
- Equality check Error should not be thrown
- Suport overriding functions HOT 12
- AggregateEvaluators is a mess HOT 4
- Migrate to eslint HOT 1
- Enable `no-redeclare` rule HOT 52
- Enable `no-implicit-globals` rule HOT 3
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 sparqlee.