本文整理匯總了VB.NET中System.Math.Floor方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET Math.Floor方法的具體用法?VB.NET Math.Floor怎麽用?VB.NET Math.Floor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Math
的用法示例。
在下文中一共展示了Math.Floor方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: values
Dim values() As Double = {7.03, 7.64, 0.12, -0.12, -7.1, -7.6}
Console.WriteLine(" Value Ceiling Floor")
Console.WriteLine()
For Each value As Double In values
Console.WriteLine("{0,7} {1,16} {2,14}", _
value, Math.Ceiling(value), Math.Floor(value))
Next
輸出:
Value Ceiling Floor 7.03 8 7 7.64 8 7 0.12 1 0 -0.12 0 -1 -7.1 -7 -8 -7.6 -7 -8
示例2: values
Dim values() As Decimal = {7.03d, 7.64d, 0.12d, -0.12d, -7.1d, -7.6d}
Console.WriteLine(" Value Ceiling Floor")
Console.WriteLine()
For Each value As Decimal In values
Console.WriteLine("{0,7} {1,16} {2,14}", _
value, Math.Ceiling(value), Math.Floor(value))
Next
輸出:
Value Ceiling Floor 7.03 8 7 7.64 8 7 0.12 1 0 -0.12 0 -1 -7.1 -7 -8 -7.6 -7 -8
示例3: Module1
Module Module1
Sub Main()
Console.WriteLine("Ceiling(1.1), Ceiling(0.9) = " & Math.Ceiling(1.1) & " " & Math.Ceiling(0.9))
Console.WriteLine("Exp(5) = " & Math.Exp(5))
Console.WriteLine("Log10(100) = " & Math.Log10(100))
Console.WriteLine("Max(1001, 100) = " & Math.Max(1001, 100))
Console.WriteLine("Min(1001, 100) = " & Math.Min(1001, 100))
Console.WriteLine("Floor(1.1), Floor(0.9) = " & Math.Floor(1.1) & " " & Math.Floor(0.9))
Console.WriteLine("Round(1.1), Round(0.9) = " & Math.Round(1.1) & " " & Math.Round(0.9))
End Sub
End Module