Modulus function
-
hi all, How to calculate the Modulus Function in C#.net for example :|3-4|>1 what could be its precedence .
usharani
% 10%2
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);Morgonen är tröttmans mecka
-
hi all, How to calculate the Modulus Function in C#.net for example :|3-4|>1 what could be its precedence .
usharani
-
hi all, How to calculate the Modulus Function in C#.net for example :|3-4|>1 what could be its precedence .
usharani
If you really mean what you say - modulus (as in remainder from division), see the post from laserbaronen (% is the modulus operator in C#). If you're doing scientific calculations and you want the IEEE specification of the remainder operation, use
Math.IEEERemainder()
instead. If you mean the absolute value (as in |-1| = 1, which could be infered from your example), see the post from Shree (Math.Abs does that). The precedence of the modulus operator (%) can be found in the C# reference (which shouldn't be further from you than the F1 key and a couple of mouse clicks). It's in the multiplicative operator group (same precedence as * and /).-- Peter