Does c# have a function that returns a boolean for expression : if(value.inRange(-1.0,1.0)){}?
Does c# have a function that returns a boolean for expression : if(value.inRange(-1.0,1.0)){} ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Description
I suggest you use a extension method.
You can create this extension method in a generic way (thx to digEmAll and CodeInChaos, who suggest that). Then you can use that on every object that implements
IComparable.Solution
then you do this
Update for perfectionists
After an extensive discussion with @CodeInChaos who said
You can name the function
IsInOpenIntervaltoo.More Information