vb.net Code:
Imports System.Drawing
Imports System.Numerics
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
TextBox1.Text = SumOfIntegers(BigInteger.Parse(TextBox1.Text)).ToString
End Sub
Public Function SumOfIntegers(ByVal int As BigInteger) As BigInteger
Dim bsum As BigInteger = 0
For i As BigInteger = 1 To int
bsum += i
Next
Return bsum
End Function
End Class
Thank you, this works.... But, the performance when I use the value of 1200500200 to start the Function, is very poor. Much slower than I would have expected. Through using breakpoints I have discovered that this line is the slowing cause
Would a BGW make this maybe a little faster? I have an i7 clocking at 2.8ghz right now.