-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API Proposal/Question]: IFloatingPoint<TSelf> is totally base 2 IEEE 1985 oriented. We also need the basics for base10/decimal and other rational/fraction/real like numbers #62293
Comments
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsBackground and motivationI know IFloatingPoint has this covered, but the interface is MUCH too big for other floating/fixed point/fractional numbers to support it. We need a more basic (more generic) fractional number abstraction for all "real" like types (IEEE, decimal, Rational/Fraction/FixedPointNumber etc). Functions like
are concepts of all fractional numbers (aka fractions). For floating point types (decimal and IEEE types) you could add
I am guessing that decimal (base 10) floating point numbers can be sorted (bit traversed), but I am not 100 pct sure, have to check!?! Before a more precise API proposal. Is this an oversight? Are you working on something without NaN, Denormalized/Subnormal, +/- infinity , +/-zero, and all the other IEEE 1985 related static methods that can be used with (supported by) for example System.Decimal? And maybe something without the many trigonometric and logarithmic functions? API Proposalnamespace System.Collections.Generic
{
public class MyFancyCollection<T> : IEnumerable<T>
{
public void Fancy(T item);
}
} API Usage// Fancy the value
var c = new MyFancyCollection<int>();
c.Fancy(42);
// Getting the values out
foreach (var v in c)
Console.WriteLine(v); Alternative DesignsNo response RisksNo response
|
@tannergooding 2 things.
|
@maxild, the first issue is #62840.
It is intentionally IEEE 754 (actually 2008/2019, not 1985) centric. Most of the operations, like transcedental functions, powers, logarithms, etc are not generally applicable. They only function "well" in the presence of support for things like There may be a few tweaks or additional splits we can make for it to be a bit more fine grained and usable by other types, where applicable; and this is something I'm looking at; but I expect a large portion of this will be limited. |
The latest design is updated to have See the base document and additional changes covered in dotnet/designs#262 |
Background and motivation
I know
IFloatingPoint<TSelf>
has this covered, but the interface is MUCH too big for other floating/fixed point/fractional numbers to support it.We need a more basic (more generic) fractional number abstraction for all "real" like types (IEEE, decimal, Rational/Fraction/FixedPointNumber etc).
Functions like
are concepts of all fractional numbers (aka fractions).
For floating point types (decimal and IEEE types) you could add
I am guessing that
System.Decimal
(base 10) floating point numbers can be sorted (bit traversed), but I am not 100 pct sure, have to check the precise encoding used inDecimal.cs
!?!Before a more precise API proposal. Is this an oversight? Are you working on something without NaN, Denormalized/Subnormal, +/- infinity , +/-zero, and all the other IEEE 1985 related static methods that can be used with (supported by) for example System.Decimal? And maybe something without the many trigonometric and logarithmic functions?
API Proposal
API Usage
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: