This example demonstrates Math.Max() : Math « Development « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » Development » Math 
7.15.7.This example demonstrates Math.Max()
Class Sample
   Public Shared Sub Main()
      Dim xByte1 As Byte = 1

      Dim xByte2 As Byte = 51
      Dim xShort1 As Short = - 2
      Dim xShort2 As Short = 52
      Dim xInt1 As Integer = - 3
      Dim xInt2 As Integer = 53
      Dim xLong1 As Long = - 4
      Dim xLong2 As Long = 54
      Dim xSingle1 As Single = 5F
      Dim xSingle2 As Single = 55F
      Dim xDouble1 As Double = 6.0
      Dim xDouble2 As Double = 56.0
      Dim xDecimal1 As [Decimal7D
      Dim xDecimal2 As [Decimal57D

      Dim xSByte1 As SByte = 101
      Dim xSByte2 As SByte = 111
      Dim xUShort1 As UShort = 102
      Dim xUShort2 As UShort = 112
      Dim xUint1 As UInteger = 103
      Dim xUint2 As UInteger = 113
      Dim xUlong1 As ULong = 104
      Dim xUlong2 As ULong = 114


      Console.WriteLine(Math.Max(xByte1, xByte2))
      Console.WriteLine(Math.Max(xShort1, xShort2))
      Console.WriteLine(Math.Max(xInt1, xInt2))
      Console.WriteLine(Math.Max(xLong1, xLong2))
      Console.WriteLine(Math.Max(xSingle1, xSingle2))
      Console.WriteLine(Math.Max(xDouble1, xDouble2))
      Console.WriteLine(Math.Max(xDecimal1, xDecimal2))

      Console.WriteLine(Math.Max(xSByte1, xSByte2))
      Console.WriteLine(Math.Max(xUShort1, xUShort2))
      Console.WriteLine(Math.Max(xUint1, xUint2))
      Console.WriteLine(Math.Max(xUlong1, xUlong2))
   End Sub
End Class
7.15.Math
7.15.1.Math.Sqrt and Atan2
7.15.2.Math. Cos and Sin
7.15.3.Convert rectangular 3D coordinates to cylindrical coordinates.
7.15.4.Generating random integers.
7.15.5.Math.Round
7.15.6.Randomize
7.15.7.This example demonstrates Math.Max()
7.15.8.Use the Min method to return and display the smaller of two Single variables.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.