Module Module1
Sub Main()
Dim t As Long
Dim tt As Double
Dim h As Double
Dim i As Long
Console.Title = "vb.net2008浮点运算测试"
'Console.BackgroundColor = ConsoleColor.Cyan
Console.WindowWidth = 50
Console.WindowHeight = 10
Console.WriteLine("计算1亿以内所有自然数开3次方并求和")
Console.WriteLine("按任意键开始计算:")
Console.ReadKey()
Console.WriteLine()
Console.WriteLine("正在计算,请稍候……")
t = System.Environment.TickCount
For i = 1 To 99999999
h = h + Math.Pow(i, 1 / 3)
Next
Console.Clear()
Console.WriteLine("结果:" + h.ToString)
tt = (System.Environment.TickCount - t) / 1000
Console.WriteLine("用时:" + tt.ToString + " 秒")
Console.ReadKey()
End Sub
End Module