Tutorial Programming

Tutorial basic, Visual Studio VB.NET 2013 Pengunaan Math Function


Hallo sahabat saya akan menjelaskan Pengunaan Math Function pada visual studio 2013, oke langsung aja


Abs

Private Sub BtnComp_Click(sender As Object, e As EventArgs) Handles BtnComp.Click
LblAbs.Text = Math.Abs(Val(TxtNum.Text))
End Sub




Math.Exp (number)

Private Sub BtnComp_Click(sender As Object, e As EventArgs) Handles BtnComp.Click
LblExp.Text = Math.Exp(Val(TxtNum.Text))
End Sub





Fix

Private Sub BtnComp_Click(sender As Object, e As EventArgs) Handles BtnComp.Click
LblFixNum1.Text = Fix(Val(TxtPosNum.Text))
LblFixNum2.Text = Fix(Val(TxtNegNum.Text))
End Sub





Int 

Int(2.4)=2, Int(6.9)=6 , Int(-5.7)=-6, Int(-99.8)=-100




Log 


Private Sub BtnComp_Click(sender As Object, e As EventArgs) Handles BtnComp.Click
LblLog.Text = Math.Log(Val(TxtNum.Text))
End Sub







Rnd( ) 


Private Sub BtnGen_Click(sender As Object, e As EventArgs) Handles BtnGen.Click
LblRnd.Text = Int(VBMath.Rnd() * 6) + 1
End Sub





Round 


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Label1.Text = Math.Round(Val(TextBox1.Text), 2)
End Sub





Sekian tutorial saya sahabat semoga bermanfaat yah.

No comments:

Post a Comment

Tutorial Programming Designed by Templateism | Ary EJFA Copyright © 2015

Theme images by richcano. Powered by Blogger.