Click here to Skip to main content
16,005,038 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to Add a Font in Setup Project Pin
Rupesh Kumar Swami10-Feb-08 20:39
Rupesh Kumar Swami10-Feb-08 20:39 
GeneralAn unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll in c# Pin
ramyanaidu10-Feb-08 18:36
ramyanaidu10-Feb-08 18:36 
GeneralRe: An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll in c# Pin
Martin#10-Feb-08 20:24
Martin#10-Feb-08 20:24 
GeneralPrinting 128-bit integer in decimal Pin
Skippums10-Feb-08 15:59
Skippums10-Feb-08 15:59 
GeneralRe: Printing 128-bit integer in decimal Pin
Luc Pattyn11-Feb-08 1:41
sitebuilderLuc Pattyn11-Feb-08 1:41 
GeneralRe: Printing 128-bit integer in decimal Pin
Skippums11-Feb-08 5:20
Skippums11-Feb-08 5:20 
GeneralRe: Printing 128-bit integer in decimal Pin
Luc Pattyn11-Feb-08 6:06
sitebuilderLuc Pattyn11-Feb-08 6:06 
AnswerRe: Printing 128-bit integer in decimal Pin
Skippums11-Feb-08 5:50
Skippums11-Feb-08 5:50 
Found it. In my Divide method, my logic was as follows:
1. If divisor == 0, throw DivideByZeroException
2. If divisor > dividend, return (0 R dividend)
3. If divisor == dividend, return (1 R 0)
4. Shift the divisor left until Log2(divisor) == Log2(dividend)
5. While the dividend > ulong.MaxValue, do repeated subtraction
6. Use the built-in ulong division / modulo methods to obtain the result.
My error was in step #5. In my divide method, I continued doing repeated subtraction until the number of bits in the shifted divisor was < 64. However, just because the base-2 log of the divisor was < 64 does not mean that the partial difference is as well. I simply changed the condition "divBits >= 64" to "divBits >= 63", and it now works just fine, as the partial difference is now guaranteed to be <= ulong.MaxValue. Thanks for the help,

Sounds like somebody's got a case of the Mondays

-Jeff

QuestionBackground image refreshing on Form resizing? Pin
Jacob Dixon10-Feb-08 13:19
Jacob Dixon10-Feb-08 13:19 
AnswerRe: Background image refreshing on Form resizing? Pin
Jacob Dixon10-Feb-08 13:27
Jacob Dixon10-Feb-08 13:27 
QuestionNew gradient background for Button...? Pin
Edmundisme10-Feb-08 11:23
Edmundisme10-Feb-08 11:23 
AnswerRe: New gradient background for Button...? Pin
Joachim Kerschbaumer10-Feb-08 21:48
Joachim Kerschbaumer10-Feb-08 21:48 
GeneralRe: New gradient background for Button...? Pin
Edmundisme11-Feb-08 7:37
Edmundisme11-Feb-08 7:37 
AnswerRe: New gradient background for Button...? Pin
Abhijit Jana10-Feb-08 22:03
professionalAbhijit Jana10-Feb-08 22:03 
GeneralRe: New gradient background for Button...? Pin
Edmundisme11-Feb-08 7:38
Edmundisme11-Feb-08 7:38 
AnswerRe: New gradient background for Button...? Pin
Ravenet11-Feb-08 3:13
Ravenet11-Feb-08 3:13 
GeneralRe: New gradient background for Button...? Pin
Edmundisme11-Feb-08 7:38
Edmundisme11-Feb-08 7:38 
GeneralAssigning a control back to the main form in the DragOver method... [modified] Pin
new_phoenix10-Feb-08 9:13
new_phoenix10-Feb-08 9:13 
GeneralApplication of Digital Dictionary Pin
Abdul8510-Feb-08 7:23
Abdul8510-Feb-08 7:23 
GeneralDouble post - please ignore Pin
pmarfleet10-Feb-08 7:51
pmarfleet10-Feb-08 7:51 
GeneralBest approach Pin
pokabot10-Feb-08 6:41
pokabot10-Feb-08 6:41 
GeneralRe: Best approach Pin
Pete O'Hanlon10-Feb-08 10:10
mvePete O'Hanlon10-Feb-08 10:10 
GeneralRe: Best approach Pin
pokabot10-Feb-08 10:30
pokabot10-Feb-08 10:30 
GeneralCreate a windows explorer toolbar in .NET Pin
Yevgeny Efter10-Feb-08 6:05
Yevgeny Efter10-Feb-08 6:05 
GeneralRe: Create a windows explorer toolbar in .NET Pin
Mircea Puiu10-Feb-08 23:33
Mircea Puiu10-Feb-08 23:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.