Imports System.Diagnostics
Console.WriteLine("Double/Decimal Performance Test")
Console.WriteLine("Double/Decimal Precision Test")
Private iterations As Integer = 100000000
Private Sub DoubleSpeedTest()
Dim watch As Stopwatch = New Stopwatch()
For i As Integer = 0 To iterations - 1
Console.WriteLine("Double: " & watch.ElapsedTicks)
Private Sub DecimalSpeedTest()
Dim watch As Stopwatch = New Stopwatch()
For i As Integer = 0 To iterations - 1
Console.WriteLine("Decimal: " & watch.ElapsedTicks)
Private Sub DoublePrecisionTest()
Private Sub DecimalPrecisionTest()
Private Sub NotationTest()
dim notationS as single = 99999999
dim notationD as double = 99999999
dim notationDec as decimal = 99999999
Console.WriteLine("Precision also becomes an issue with greater numeric values. ")
Console.WriteLine(" Singles round to scientific notation at the tens of millions. ")
Console.WriteLine(" Scientific Notation Single - Tens of million")
Console.WriteLine(" 99,999,999")
Console.WriteLine(" Single:" & notationS)
Console.WriteLine(" Double:" & notationD)
Console.WriteLine(" Decimal:" & notationDec)
notationD = 9999999999999999
notationDec = 9999999999999999
Console.WriteLine(" Doubles round to scientific notation at the quadrillions. ")
Console.WriteLine(" Scientific Notation Double - Quadrillion")
Console.WriteLine(" 9,999,999,999,999,999")
Console.WriteLine(" Double:" & notationD)
Console.WriteLine(" Decimal:" & notationDec)