本文整理汇总了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