Questions tagged [.net-generic-math]

.NET 7 and C# 11 include innovations that allow you to perform mathematical operations generically — that is, without having to know the exact type you're working with.

.NET 7 and C# 11 include innovations that allow you to perform mathematical operations generically — that is, without having to know the exact type you're working with. For example, if you wanted to write a method that adds two numbers, previously you had to add an overload of the method for each type. Now you can write a single, generic method, where the type parameter is constrained to be a number-like type. For more information, see the Generic math article and the Generic math blog post.

17 questions
0
votes
1 answer

Why does IParseable need to be recursive?

Why does IParseable place the T : IParseable constraint on T? What is this recursive constraint needed for?
Marcin
  • 131
  • 6
0
votes
1 answer

How can I use IAdditionOperators<,,> from .NET 6 preview 7?

I have installed .NET 6 Preview 7 successfully. I have access to System.IAdditionOperators<,,>. My problem is that when I try to implement the interface it doesn't require me to define the + operator. My project file:
Nigel
  • 2,961
  • 1
  • 14
  • 32
1
2