© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•13mo ago•
39 replies
Faker

✅ Can someone explain how this ternary expression works

total -= TotalMeetsMinimum() ? 5.00 : 0.00;
total -= TotalMeetsMinimum() ? 5.00 : 0.00;


Given that TotalMeetsMinimum returns a boolean.

I don't understand because of the
-=
-=
symbol, like here, it's like we are doing
total = total - TotalMeetsMinimum() ? 5.00 : 0.00;
total = total - TotalMeetsMinimum() ? 5.00 : 0.00;
?
If no, then how do we read that expression please
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Can someone explain how this works?
C#CC# / help
5mo ago
Can someone explain to me how this works
C#CC# / help
3y ago
Can someone explain this variable and how this works?
C#CC# / help
3y ago
Can someone explain this for me
C#CC# / help
4y ago