RationalNumerics
RationalNumerics copied to clipboard
Consolidate duplicate configuration
Configuration applied both to Debug and Release, so I merge this settings. Obviously unrelated to bug, but cannot resist and not cleanup
Hello, no problem, would you like to work together?
I already figure out the issue with drag drop. FYI: Also on RC1 you have to implement bunch of methods and properties and Pi property can be a problem for example
Please, whats the problem with Pi? And witch (group of) functions are missing?
public static BigRational Pi(int digits)
This interface https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Numerics/IFloatingPoint.cs
now derives from this one https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Numerics/IFloatingPointConstants.cs
as you will see, it has Pi property. You cannot have property Pi and method Pi() in the same class.
Thanks, I see, so far I don't support IFoatingPoint. It wouldn't be no problem to implement something, but does it make sense for such a number type? There is no constant for this, not even a cache (but it is planned). Within calculations, even low-level, cpu.sin, cpu.tan, when pi is requested, it is calculated in real-time in the currently desired precision.
But these are the design questions I really need help with. It would be easy and quick to change everything.
You cannot not implement it, or you have to implement, but make it throw NotImplementedException, that interface is part of INumber<T> so with latest preview or nightly RC1 you will hit compilation error
I use this as reference: https://source.dot.net/#System.Private.CoreLib/INumber.cs,0f558758e750a740 and https://source.dot.net/#System.Private.CoreLib/IFloatingPointConstants.cs,9ff158e2a0a8fb1f
There in INumber and INumberBase IFloatingPointConstants is not included. Is there a better link for pre-versions or something?
I'm not sure from which version of .NET source.dot.net gets source code, but I give you source code for latest bits from main branch. That's where dev works. And that's for sure would be either in Preview 7, or in RC1. If you install RC1 from here https://github.com/dotnet/installer you will see the issue yourself. Just be prepared before release to update things.
Please take a look at approximate changes which would be required https://github.com/c-ohle/RationalNumerics/pull/7
Many thanks for the hints - I need time to check. And sorry for the CreatePixelShader bug - but would be interesting to know what graphics hardware it is, usually there is a fallback to the reference renderer.
I have it, they put IFloatingPointConstants in IRootFunctions, ITrigonometricFunctions. What nonsense. Anyway, will update that it works and check in. Will think later how to create a halfway logically interface on this - this time probably with a glass of vodka.
Thanks for hardware... Maybe the mentioned further drag-drop bugs fixed - will check and let you know.
My idea was rename Pi to AproximatePi, that way methods still make sense. Just an idea
This works too:
static BigRational IFloatingPointConstants<BigRational>.Pi => Pi(1000) // :-)
Thanks again, that was all very helpful. Latest NET7 version checked in, no more conflicts. Maybe the DX11 problem is solved too.
From this morning, have you seen the last notes? These problems are definitely still in. Probably relating to issue 6976 but must somewhere else in the source and this since longer. Before I start a new issue, it will probably go faster if you continue this.
Please not wondering if BigInteger sometimes crashes.
I found some old bugs are fixed. Also BigInteger bugs I reported. But there is a new issue with BigInteger and maybe mutch deeper in the system. In the tests and benchmarks, after massive calculations BigInteger calculates wrong numbers, sometimes exceptions, but it's not determined, does not depend on the numbers.
Maybe they forgot a span.Clear() but two times I got exception from ArrayPool