remainder
-
hi..... probably a stupid question...but can someone pls tell me how can i get the remainder of a devision in C#??? lets say 3/2 i need to get the reaminder and the quotient seperately... can anyone help? tks...:) Have a Super Blessed Day! ------------------------- For God has not given us a spirit of fear, but of power and of love and of a sound mind. 2 Timothy 1:7 "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life." John 3:16 "Therefore you also be ready, for the Son of Man is coming at an hour you do not expet." Luke 12:40
-
hi..... probably a stupid question...but can someone pls tell me how can i get the remainder of a devision in C#??? lets say 3/2 i need to get the reaminder and the quotient seperately... can anyone help? tks...:) Have a Super Blessed Day! ------------------------- For God has not given us a spirit of fear, but of power and of love and of a sound mind. 2 Timothy 1:7 "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life." John 3:16 "Therefore you also be ready, for the Son of Man is coming at an hour you do not expet." Luke 12:40
-
3%2 =1 leppie::AllocCPArticle("Zee blog");
Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.are u saying if i do int 1 = 3%2 i will get 1? Have a Super Blessed Day! ------------------------- For God has not given us a spirit of fear, but of power and of love and of a sound mind. 2 Timothy 1:7 "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life." John 3:16 "Therefore you also be ready, for the Son of Man is coming at an hour you do not expet." Luke 12:40
-
are u saying if i do int 1 = 3%2 i will get 1? Have a Super Blessed Day! ------------------------- For God has not given us a spirit of fear, but of power and of love and of a sound mind. 2 Timothy 1:7 "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life." John 3:16 "Therefore you also be ready, for the Son of Man is coming at an hour you do not expet." Luke 12:40
Yep. That's exactly what he meant. % is a remainder operator in C#, just like / is for division. Rakesh Rakesh
-
hi..... probably a stupid question...but can someone pls tell me how can i get the remainder of a devision in C#??? lets say 3/2 i need to get the reaminder and the quotient seperately... can anyone help? tks...:) Have a Super Blessed Day! ------------------------- For God has not given us a spirit of fear, but of power and of love and of a sound mind. 2 Timothy 1:7 "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life." John 3:16 "Therefore you also be ready, for the Son of Man is coming at an hour you do not expet." Luke 12:40
int intRemainder = 0; Math.DivRem(int1, int2, out intRemainder); --- or --- int intRemainder = int1 % int2; The 2nd way is what Joseph was talking about. The first way is longer however it is using .NET routines so it is safer if you care about cross coding. I would normally always use the second method.
-
int intRemainder = 0; Math.DivRem(int1, int2, out intRemainder); --- or --- int intRemainder = int1 % int2; The 2nd way is what Joseph was talking about. The first way is longer however it is using .NET routines so it is safer if you care about cross coding. I would normally always use the second method.
tks...i was looking for a Math fn....:) Have a Super Blessed Day! ------------------------- For God has not given us a spirit of fear, but of power and of love and of a sound mind. 2 Timothy 1:7 "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life." John 3:16 "Therefore you also be ready, for the Son of Man is coming at an hour you do not expet." Luke 12:40
-
tks...i was looking for a Math fn....:) Have a Super Blessed Day! ------------------------- For God has not given us a spirit of fear, but of power and of love and of a sound mind. 2 Timothy 1:7 "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life." John 3:16 "Therefore you also be ready, for the Son of Man is coming at an hour you do not expet." Luke 12:40
=)