News for hackers. Stuff that matters.
Re:Microfeatures I'd like to see in more languages by KMag on Friday January 06, 2023 @08:00AM (#34274153)
Hmm... I haven't read the official spec, just the Microsoft documentation: https://learn.microsoft.com/en-us/dotnet/csharp/language-ref... In any case, the behavior is rem, not mod.

Ada has both rem and mod operatiors. I'm not sure how many other languages have operators for both.

Re:Microfeatures I'd like to see in more languages by cpurdy on Saturday January 07, 2023 @07:27PM (#34294653)
Ecstasy uses % for modulo, and /% for divrem (division and remainder). So "a = b % c" for calculating the modulo, but "(a, r) = b /% c" to get the divisor and remainder.