-
Notifications
You must be signed in to change notification settings - Fork 386
[Experimental] Decimal data type #5375
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
Conversation
…. Add decimalcppwinrt.h with C++ enhancements beyond what C++/WinRT projection provides (e.g. operator==).
/azp run |
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
…o not search under root\Packages (for some reason the `Where...-notmatch $exclude` is performing a case-sensntive comparison when docs say it should be csae-insensitive. A little brute-force fix to prevent the pain
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
dev/Projections/CS/Microsoft.Windows.Foundation/DecimalExtensions.cs
Outdated
Show resolved
Hide resolved
dev/Projections/CS/Microsoft.Windows.Foundation/DecimalExtensions.cs
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
One thing I noticed is that |
Unclear if/how that works given it must answer "How is https://learn.microsoft.com/en-us/uwp/api/windows.foundation.ireference-1
Perhaps Can you think of another reference besides |
WF.GuidHelper, MUX.DurationHelper, MUX.CornerRadiusHelper, MUX.GridLengthHelper, MUX.PointHelper, MUX.RectHelper, MUX.SizeHelper, MUX.ThicknessHelper MUX.Media.MatrixHelper, etc. As far as |
For CsWinRT, we implement We would do the same, automatically, for |
Yeah, afaik cppwinrt has a basic implementation for other types, my main line of thought was the IPropertyValue member methods. If that's not necessary we can easily get away with using the regular implementation in cppwinrt instead of shipping a header. |
To clarify I was agreeing with you that it'd be doable to do the same in CsWinRT if we just went with |
If we go that way, I would rename it Decimal, but yeah :) |
Decimal data type (base-10 fixed-point math!)
This is implemented over the Win32 Decimal structure as the common data representation. C#'s
System.Decimal
uses the same representation in memory (different but equivalent implementation)Recommendation is use your language's native decimal data type, if you've got one (C#, Python, ...). WinAppSDK supplements some languages to aid interop with the common data format (Decimal).
For some languages without a decimal data type WinAppSDK provides a native language data type for decimal operations and interop with the common data format. The C++
decimal
class indecimal.h
is an example of this.For languages without a decimal data type WinAppSDK provides a runtimeclass
Microsoft.Windows.Foundation.Decimal
. This is only recommended when no other language native decimal type is available.This is explained in more detail in
specs\decimal\decimal.md
. NOTE: This pre-draft is for early adopters to better understand the offering here. These APIs will stay EXPERIMENTAL until API Review is complete and whatever changes fall out of that are incorporated (could be minor, could be radical and majorly impactful).NOTE: API Review will act on separate PR reviewing a future (review-ready) form of
specs\decimal\decimal.md
. This file is purely informational at this time and not to be taken today as definitive or API Review worthy.