Proposal: Quadruple precision floats #8199
Replies: 9 comments 1 reply
-
This would require a corresponding type in CoreFX first. Additionally, given that IL doesn't support literals for non-primitive types, there would need to be an alternative mechanism for supporting As a workaround.NET Core provides the |
Beta Was this translation helpful? Give feedback.
-
Ah, I wasn't aware that .NET Core had a bignum implementation. I'll leave this open anyways because it still might be nice to have 128-bit numbers. |
Beta Was this translation helpful? Give feedback.
-
@TheUnlocked The question is what would be the benefit of 128-bit number as part of the language? I mean, "nice to have" can be interpreted as "redundant/unnecessary" so you may want to cover how the language benefits from this. |
Beta Was this translation helpful? Give feedback.
-
I initially thought that this would be useful upon seeing how the game Kerbal Space Program (written in C#) starts to bug out when you have a massive number of objects interacting with eachother due to double imprecision. While I'm not suggesting that it would make any sense to add a new language feature for a single program, that particular example shows that when dealing with massive simulations with a lot of moving pieces, doubles sometimes aren't enough. I suppose another interesting thing to see would be a benchmarking (probably written in a language that does support quadruple precision) between quads and BigNumbers, to see if quads are sufficiently faster and less memory intensive to be worth it. |
Beta Was this translation helpful? Give feedback.
-
This proposal is about implementing one of the binary formats from IEEE 754:2008 standard (currently translated into ISO/IEC/IEEE 60559:2011). In general implementation of parts or all of the IEEE 754:2008 is tracked by several issues in coreclr and corefx repos. Language support would be helpful at the level of |
Beta Was this translation helpful? Give feedback.
-
It depends on the relative performance of the type to other floating-point types. If Language support in this case either means special understanding of operators and emitting a special signature, but that means modifying CIL to support |
Beta Was this translation helpful? Give feedback.
-
Cross-reference to corresponding issue at corefx: https://github.com/dotnet/corefx/issues/17267 |
Beta Was this translation helpful? Give feedback.
-
If you are creating big number types without matching trigonometry/log functions, please have a seat. Don't waste your time. Only a complete implementation is useful, otherwise it's a high school project.
IPv6 addresses and Guid literals, derp. Quicker static initialization. Combine this with something like constexpr and it would be just lordly. |
Beta Was this translation helpful? Give feedback.
-
There is only very few hardware (source: Wikipedia) that supports quadruple precision floats. As such, (most of) the calculations would have to be implemented in software and very slow. An dedicated library would be probably a better fit for such a type than it beeing an integral part of the framework. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As the title suggests, adding a new
quad
type with a literal like3.141592653589793238462q
. I understand thatDecimal
currently exists, but it has a very small maximum range compared to the massive range of a quadruple precision float (or even just adouble
). I suppose that aqint
anduqint
could also be added as well, though probably with better thought out names.A potential drawback is that quadruple precision math doesn't tend to have the same kind of hardware acceleration that double precision math does, but sometimes the extra precision is worth that price.
Beta Was this translation helpful? Give feedback.
All reactions