Reputation: 16375
I'm developing a Xamarin Forms app in Visual Studio for Mac. I noticed that when I use the modulus operator (%) I'm receiving a warning saying "Invalid binary operator", as you can see in the image below:
maximum
and step
variables are doubles.
Despite this the value of x
is correctly calculated after this line.
My question is: what does it mean and why Why am I getting this warning?
Upvotes: 0
Views: 227
Reputation:
what does it mean
Nothing. It's incorrect. .Net supports modulus over doubles.
Why am I getting this warning?
This appears to be a defect in Xamarin. I would consider opening a ticket with them to solicit feedback from the development team.
Upvotes: 1
Reputation: 313
The little warning appears to be in error. I get no such warning when doing the same thing in VS2015. Modulo, in C#, is defined and valid on all of the numeric types. See https://msdn.microsoft.com/en-us/library/h6zfzfy7(v=vs.100).aspx
Upvotes: 2