Index: /Include/Classes/System/Math.ab
===================================================================
--- /Include/Classes/System/Math.ab	(revision 256)
+++ /Include/Classes/System/Math.ab	(revision 257)
@@ -232,18 +232,9 @@
 			Dim tmp = x * _System_InverseSqrt2
 			Dim p = VarPtr(tmp) As *QWord
-			Dim m = p[0] And &h7FF0000000000000
+			Dim m = GetQWord(p) And &h7FF0000000000000
 			Dim k = ((m >> 52) As DWord) As Long - 1022
-			p[0] = m + &h0010000000000000
+			SetQWord(p, m + &h0010000000000000)
 			x /= tmp
-
-			x--
-			Dim s = 0 As Double
-			Dim i = _System_Log_N As Long
-			While i >= 1
-				Dim t = (i * x) As Double
-				s = t / (2 + t / (2 * i + 1 + s))
-				i--
-			Wend
-			Log = _System_LOG2 * k + x / (1 + s)
+			Log = _System_LOG2 * k + _System_Log1p(x - 1)
 		End If
 	End Function
@@ -602,5 +593,4 @@
 	End Function
 Private
-	Static Const _System_Log_N = 7 As Long
 	Static Const _System_Atan_N = 20 As Long
 	Static Const _System_UrTan_N = 17 As Long
Index: /Include/Classes/System/OperatingSystem.ab
===================================================================
--- /Include/Classes/System/OperatingSystem.ab	(revision 256)
+++ /Include/Classes/System/OperatingSystem.ab	(revision 257)
@@ -10,5 +10,5 @@
 Public
 	' Constractor
-	Sub OperatingSystem(platform As PlatformID, version As Version)
+	Sub OperatingSystem(platform As PlatformID, version As System.Version)
 		pf = platform
 		ver = version
@@ -18,5 +18,5 @@
 	Sub OperatingSystem(vi As OSVERSIONINFOA)
 		pf = vi.dwPlatformId As PlatformID
-		ver = New Version(vi.dwMajorVersion, vi.dwMinorVersion, vi.dwBuildNumber)
+		ver = New System.Version(vi.dwMajorVersion, vi.dwMinorVersion, vi.dwBuildNumber)
 		sp = New String(vi.szCSDVersion As PCSTR)
 	End Sub
@@ -24,5 +24,5 @@
 	Sub OperatingSystem(vi As OSVERSIONINFOW)
 		pf = vi.dwPlatformId As PlatformID
-		ver = New Version(vi.dwMajorVersion, vi.dwMinorVersion, vi.dwBuildNumber)
+		ver = New System.Version(vi.dwMajorVersion, vi.dwMinorVersion, vi.dwBuildNumber)
 		sp = New String(vi.szCSDVersion As PCSTR)
 	End Sub
@@ -33,5 +33,5 @@
 	End Function
 
-	Const Function Version() As Version
+	Const Function Version() As System.Version
 		Return ver
 	End Function
@@ -71,5 +71,5 @@
 Private
 	pf As PlatformID
-	ver As Version
+	ver As System.Version
 	sp As String
 End Class
Index: /Include/Classes/System/Runtime/InteropServices/GCHandle.ab
===================================================================
--- /Include/Classes/System/Runtime/InteropServices/GCHandle.ab	(revision 256)
+++ /Include/Classes/System/Runtime/InteropServices/GCHandle.ab	(revision 257)
@@ -12,5 +12,5 @@
 	Sub Target(obj As Object)
 		allocated.Add(obj)
-		handle = VarPtr(obj) 'ObjPtr
+		handle = ObjPtr(obj)
 	End Sub
 
Index: /Include/Classes/System/Version.ab
===================================================================
--- /Include/Classes/System/Version.ab	(revision 256)
+++ /Include/Classes/System/Version.ab	(revision 257)
@@ -5,4 +5,6 @@
 
 #require <api_winsock2.sbp>
+
+Namespace System
 
 Class Version
@@ -149,3 +151,5 @@
 End Class
 
+End Namespace 'System
+
 #endif '__SYSTEM_VERSION_AB__
Index: /Include/basic/function.sbp
===================================================================
--- /Include/basic/function.sbp	(revision 256)
+++ /Include/basic/function.sbp	(revision 257)
@@ -9,4 +9,5 @@
 Const _System_LOG2 = 0.6931471805599453094172321214581765680755
 Const _System_SQRT2 = 1.41421356237309504880168872421
+Const _System_Log_N = 7 As Long
 
 
@@ -21,10 +22,7 @@
 		Exit Function
 	End If
-	Dim pSrc As *QWord, pDest As *QWord
-	pSrc = VarPtr(x) As *QWord
-	pDest = VarPtr(ldexp) As *QWord
-
+	Dim pSrc = VarPtr(x) As *QWord
+	Dim pDest = VarPtr(ldexp) As *QWord
 	n += (pSrc[0] >> 52) As DWord And &h7FF
-
 	pDest[0] = n << 52 Or (pSrc[0] And &h800FFFFFFFFFFFFF)
 End Function
@@ -37,7 +35,6 @@
 	End If
 
-	Dim pSrc As *QWord, pDest As *QWord
-	pSrc = VarPtr(x) As *QWord
-	pDest = VarPtr(frexp) As *QWord
+	Dim pSrc = VarPtr(x) As *QWord
+	Dim pDest = VarPtr(frexp) As *QWord
 	n = ((pSrc[0] >> 52) As DWord And &h7FF) - 1022
 	pDest[0] = (pSrc[0] And &h800FFFFFFFFFFFFF) Or &h3FE0000000000000
@@ -100,5 +97,5 @@
 End Function
 
-Function _System_GetInf(sign As BOOL) As Double
+Function _System_GetInf(sign As Boolean) As Double
 	Dim s = 0 As QWord
 	If sign Then s = 1 << 63
@@ -115,5 +112,5 @@
 End Function
 
-Function _System_GetInf(sign As BOOL) As Double
+Function _System_GetInf(sign As Boolean) As Double
 	Dim s = 0 As DWord
 	If sign Then s = (1 As DWord) << 31
@@ -240,4 +237,27 @@
 End Function
 
+Function Log1p(x As Double) As Double
+	If x < -1 Or IsNaN(x) Then
+		Log1p = _System_GetNaN()
+	ElseIf x = 0 Then
+		x = 0
+	ElseIf IsInf(x) Then
+		Log1p = x
+	Else
+		Log1p = _System_Log1p(x)
+	End If
+End Function
+
+Function _System_Log1p(x As Double) As Double
+	Dim s = 0 As Double
+	Dim i = 7 As Long
+	While i >= 1
+		Dim t = (i * x) As Double
+		s = t / (2 + t / (2 * i + 1 + s))
+		i--
+	Wend
+	Return x / (1 + s)
+End Function
+
 Function Sgn(number As Double) As Long
 	Sgn = Math.Sign(number)
@@ -293,5 +313,5 @@
 	Dim p As *DWord
 	p = VarPtr(x) As *DWord
-	IsNaN = FALSE
+	IsNaN = False
 	If (p[1] And &H7FF00000) = &H7FF00000 Then
 		If (p[0] <> 0) Or ((p[1] And &HFFFFF) <> 0) Then
@@ -299,6 +319,4 @@
 		End If
 	End If
-
-'	IsNaN=FALSE
 End Function
 
@@ -307,5 +325,5 @@
 	p = VarPtr(x) As *DWord
 	p[1] And= &h7fffffff
-	nan = _System_GetInf(FALSE)
+	nan = _System_GetInf(False)
 	IsInf = (memcmp(p As *Byte, VarPtr(nan), SizeOf (Double)) = 0)
 End Function
@@ -321,5 +339,5 @@
 	p[1] And= &H7FF00000
 	p[0] = 0
-	nan = _System_GetInf(/*x,*/ FALSE)
+	nan = _System_GetInf(/*x,*/ False)
 	IsFinite = (memcmp(p As BytePtr, VarPtr(nan), SizeOf (Double)) = 0)
 End Function
Index: /TestCase/SimpleTestCase/SimpleTestCase.idx
===================================================================
--- /TestCase/SimpleTestCase/SimpleTestCase.idx	(revision 256)
+++ /TestCase/SimpleTestCase/SimpleTestCase.idx	(revision 257)
@@ -10,4 +10,6 @@
 #include "GCHandleTest.ab"
 _ClearNamespaceImported
+#include "VersionTest.ab"
+_ClearNamespaceImported
 #include "PathTest.ab"
 _ClearNamespaceImported
Index: /TestCase/SimpleTestCase/SimpleTestCase.pj
===================================================================
--- /TestCase/SimpleTestCase/SimpleTestCase.pj	(revision 256)
+++ /TestCase/SimpleTestCase/SimpleTestCase.pj	(revision 257)
@@ -30,3 +30,4 @@
 StringTest.ab
 GCHandleTest.ab
+VersionTest.ab
 PathTest.ab
Index: /TestCase/SimpleTestCase/VersionTest.ab
===================================================================
--- /TestCase/SimpleTestCase/VersionTest.ab	(revision 257)
+++ /TestCase/SimpleTestCase/VersionTest.ab	(revision 257)
@@ -0,0 +1,60 @@
+'--------------------------------------------------------------------
+' Test case of Version Class
+'--------------------------------------------------------------------
+
+#require <Classes/System/Version.ab>
+
+Namespace VersionTest
+
+Sub TestMain()
+	Dim v12 = New System.Version(1, 2)
+	Dim v123 = New System.Version(1, 2, 3)
+	Dim v1234 = New System.Version(1, 2, 3, 4)
+
+	UnitTest("Version(major, minor)", String.Compare(v12.ToString(), "1.2") = 0)
+	UnitTest("Version(major, minor, build)", String.Compare(v123.ToString(), "1.2.3") = 0)
+	UnitTest("Version(major, minor, build, revision)", String.Compare(v1234.ToString(), "1.2.3.4") = 0)
+
+	UnitTest("Version.ToString(0)", String.Compare(v1234.ToString(0), "") = 0)
+	UnitTest("Version.ToString(1)", String.Compare(v1234.ToString(1), "1") = 0)
+	UnitTest("Version.ToString(2)", String.Compare(v1234.ToString(2), "1.2") = 0)
+	UnitTest("Version.ToString(3)", String.Compare(v1234.ToString(3), "1.2.3") = 0)
+	UnitTest("Version.ToString(4)", String.Compare(v1234.ToString(4), "1.2.3.4") = 0)
+
+	UnitTest("Version.Major", v1234.Major = 1)
+	UnitTest("Version.Minor", v1234.Minor = 2)
+	UnitTest("Version.Build", v1234.Build = 3)
+	UnitTest("Version.Revision", v1234.Revision = 4)
+
+	Dim v120 = New System.Version(1, 2, 0)
+	Dim v1231 = New System.Version(1, 2, 3, 1)
+	Dim v131 = New System.Version(1, 3, 1)
+	Dim v20 = New System.Version(2, 0)
+
+	UnitTest("Version (1.3.1).CompareTo(2.0) < 0", v131.CompareTo(v20) < 0)
+	UnitTest("Version (1.3.1).CompareTo(1.3.1) = 0", v131.CompareTo(v131) = 0)
+	UnitTest("Version (1.3.1).CompareTo(1.2.3.4) > 0", v131.CompareTo(v1234) > 0)
+
+	UnitTest("Version (2.0).Equals(2.0)", v20.Equals(v20))
+	UnitTest("Version Not (2.0).Equals(1.2)", Not v20.Equals(v12))
+
+	UnitTest("Version - 1.2.3.4 = 1.2.3.4", v1234 = v1234)
+	UnitTest("Version - Not 1.2.3.4 = 1.2.3", Not v1234 = v123)
+	UnitTest("Version - 1.2.3.4 <> 2.0", v1234 <> v20)
+	UnitTest("Version - Not 1.2.3.4 <> 1.2.3.4", v1234 <> v123)
+	UnitTest("Version - 1.2.3.4 > 1.2.3", v1234 > v123)
+	UnitTest("Version - 1.2.3.4 > 1.2", v1234 > v12)
+	UnitTest("Version - 1.3.1 > 1.2", v131 > v12)
+	UnitTest("Version - 1.2.0 > 1.2", v120 > v12)
+	UnitTest("Version - 1.2.3.4 > 1.2.3.1", v1234 > v1231)
+	UnitTest("Version - 1.2 < 1.2.0", v12 < v120)
+	UnitTest("Version - Not 1.2 > 1.2.0", Not v12 > v120)
+	UnitTest("Version - 1.2.3.4 => 1.2.3", v1234 => v123)
+	UnitTest("Version - 1.2.3.4 => 1.2.3.4", v1234 => v1234)
+	UnitTest("Version - Not 1.2.3.4 =< 1.2.3", Not v1234 =< v123)
+	UnitTest("Version - 1.2.3.4 =< 1.2.3.4", v1234 =< v1234)
+End Sub
+
+End Namespace
+
+VersionTest.TestMain()
