Wednesday, May 27, 2020

Excel VBA Importance of datatypes in calculation

Option Explicit

Sub testdataTypeResult()
    Dim s As Single
    Dim d As Double
    s = 3.14
    d = 3.14
    Debug.Print s - d
    Debug.Print d - s
End Sub

OUTPUT

 1.04904174680343E-07
-1.04904174680343E-07

No comments:

Post a Comment

Hot Topics