Click here to Skip to main content
15,922,533 members
Home / Discussions / C#
   

C#

 
AnswerRe: Capturing GPS data in C#.Net Pin
Bernhard Hiller18-Apr-13 21:50
Bernhard Hiller18-Apr-13 21:50 
QuestionCount the unique number of words inside a string builder(Not letters...Words)) Pin
kanamala subin18-Apr-13 2:36
kanamala subin18-Apr-13 2:36 
AnswerRe: Count the unique number of words inside a string builder(Not letters...Words)) Pin
DaveyM6918-Apr-13 2:45
professionalDaveyM6918-Apr-13 2:45 
AnswerRe: Count the unique number of words inside a string builder(Not letters...Words)) Pin
Andreas X18-Apr-13 2:47
professionalAndreas X18-Apr-13 2:47 
AnswerRe: Count the unique number of words inside a string builder(Not letters...Words)) Pin
Clifford Nelson18-Apr-13 5:09
Clifford Nelson18-Apr-13 5:09 
GeneralRe: Count the unique number of words inside a string builder(Not letters...Words)) Pin
Jasmine250118-Apr-13 6:34
Jasmine250118-Apr-13 6:34 
GeneralRe: Count the unique number of words inside a string builder(Not letters...Words)) Pin
Eddy Vluggen18-Apr-13 10:04
professionalEddy Vluggen18-Apr-13 10:04 
GeneralRe: Count the unique number of words inside a string builder(Not letters...Words)) Pin
Jasmine250118-Apr-13 11:34
Jasmine250118-Apr-13 11:34 
GeneralRe: Count the unique number of words inside a string builder(Not letters...Words)) Pin
Eddy Vluggen18-Apr-13 11:43
professionalEddy Vluggen18-Apr-13 11:43 
GeneralRe: Count the unique number of words inside a string builder(Not letters...Words)) Pin
Jasmine250118-Apr-13 11:54
Jasmine250118-Apr-13 11:54 
AnswerRe: Count the unique number of words inside a string builder(Not letters...Words)) Pin
PIEBALDconsult18-Apr-13 17:51
mvePIEBALDconsult18-Apr-13 17:51 
AnswerRe: Count the unique number of words inside a string builder(Not letters...Words)) Pin
Marc Clifton19-Apr-13 14:25
mvaMarc Clifton19-Apr-13 14:25 
GeneralOptimizing Fibonacci Calculation Pin
Max Holder18-Apr-13 2:33
professionalMax Holder18-Apr-13 2:33 
GeneralRe: Optimizing Fibonacci Calculation Pin
OriginalGriff18-Apr-13 2:51
mveOriginalGriff18-Apr-13 2:51 
GeneralRe: Optimizing Fibonacci Calculation Pin
Max Holder18-Apr-13 2:53
professionalMax Holder18-Apr-13 2:53 
GeneralRe: Optimizing Fibonacci Calculation Pin
OriginalGriff18-Apr-13 2:57
mveOriginalGriff18-Apr-13 2:57 
GeneralRe: Optimizing Fibonacci Calculation Pin
Max Holder18-Apr-13 2:59
professionalMax Holder18-Apr-13 2:59 
AnswerRe: Optimizing Fibonacci Calculation Pin
Kenneth Haugland18-Apr-13 3:06
mvaKenneth Haugland18-Apr-13 3:06 
GeneralRe: Optimizing Fibonacci Calculation Pin
Max Holder18-Apr-13 3:14
professionalMax Holder18-Apr-13 3:14 
GeneralRe: Optimizing Fibonacci Calculation Pin
Kenneth Haugland18-Apr-13 3:23
mvaKenneth Haugland18-Apr-13 3:23 
AnswerRe: Optimizing Fibonacci Calculation Pin
Kenneth Haugland18-Apr-13 3:51
mvaKenneth Haugland18-Apr-13 3:51 
GeneralRe: Optimizing Fibonacci Calculation Pin
Max Holder18-Apr-13 3:57
professionalMax Holder18-Apr-13 3:57 
QuestionRe: Optimizing Fibonacci Calculation Pin
Kenneth Haugland18-Apr-13 4:08
mvaKenneth Haugland18-Apr-13 4:08 
AnswerRe: Optimizing Fibonacci Calculation Pin
Max Holder18-Apr-13 4:10
professionalMax Holder18-Apr-13 4:10 
GeneralRe: Optimizing Fibonacci Calculation Pin
Kenneth Haugland18-Apr-13 4:16
mvaKenneth Haugland18-Apr-13 4:16 
The code looks like this:
VB
Private Function GetFib3(ByVal n As Integer) As ULong
       Dim a As Int64 = 0
       Dim b As Int64 = 1

       If (n = 0) Then Return a
       If (n = 1) Then Return b

       For i As UInt64 = 2 To n
           a = a Xor b
           b = b Xor a
           a = a Xor b

           ' add
           b += a
       Next

       Return b
   End Function


And it always gives me trouble with aretmetic overflow on the add part.

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.