这是一个asp.net的全文教程.里面还有数据库的数据.对初学者有很大的帮助
源代码在线查看: ch12-03-01.aspx
Ch12-03-01.aspx System.Math数学类的数值运算
System.Math数学类的数值运算
Dim ValueA As Double
' 返回最大值和最小值
Response.Write("返回最大值Max(29, 64):" & Math.Max(29, 64) & "")
Response.Write("返回最小值Min(29, 64):" & Math.Min(29, 64) & "")
' 返回绝对值
ValueA = -36.5
Response.Write("返回绝对值Abs(" & ValueA & "):" & Math.Abs(ValueA) & "")
' 返回大于参数的最小值
ValueA = 3.1415926
Response.Write("返回大于Ceiling(" & ValueA & ")参数的最小值:" & Math.Ceiling(ValueA) & "")
ValueA = -3.1415926
Response.Write("返回大于Ceiling(" & ValueA & ")参数的最小值:" & Math.Ceiling(ValueA) & "")
' 返回小于参数的最大值
ValueA = 3.1415926
Response.Write("返回小于Floor(" & ValueA & ")参数的最大值:" & Math.Floor(ValueA) & "")
ValueA = -3.1415926
Response.Write("返回小于Floor(" & ValueA & ")参数的最大值:" & Math.Floor(ValueA) & "")
' 返回四舍五入的运算结果
Response.Write("返回Round(3.4)四舍五入的运算结果:" & Math.Round(3.4) & "")
Response.Write("返回Round(3.5)四舍五入的运算结果:" & Math.Round(3.5) & "")
Response.Write("返回Round(3.6)四舍五入的运算结果:" & Math.Round(3.6) & "")
Response.Write("返回Round(6.44, 1)四舍五入的运算结果:" & Math.Round(6.44, 1) & "")
Response.Write("返回Round(6.45, 1)四舍五入的运算结果:" & Math.Round(6.55, 1) & "")
Response.Write("返回Round(6.46, 1)四舍五入的运算结果:" & Math.Round(6.46, 1) & "")
%>