Index: /Include/Classes/System/Math.ab
===================================================================
--- /Include/Classes/System/Math.ab	(revision 243)
+++ /Include/Classes/System/Math.ab	(revision 244)
@@ -133,5 +133,5 @@
 		If IsNaN(x) Then
 			Return x
-				ElseIf IsInf(x) Then
+		ElseIf IsInf(x) Then
 			Return _System_GetNaN()
 		End If
@@ -224,5 +224,5 @@
 	Static Function Log(x As Double) As Double
 		If x = 0 Then
-			Log = _System_GetInf(TRUE)
+			Log = _System_GetInf(True)
 		ElseIf x < 0 Or IsNaN(x) Then
 			Log = _System_GetNaN()
@@ -230,18 +230,19 @@
 			Log = x
 		Else
-			Dim i As Long, k As Long
-			Dim s As Double, t As Double
-			frexp(x / _System_SQRT2, k)
-			x /= ldexp(1, k)
+			Dim tmp = x * _System_InverseSqrt2
+			Dim p = VarPtr(tmp) As *QWord
+			Dim m = p[0] And &h7FF0000000000000
+			Dim k = ((m >> 52) As DWord) As Long - 1022
+			p[0] = m + &h0010000000000000
+			x /= tmp
 
 			x--
-			s = 0
-			i = _System_Log_N
+			Dim s = 0 As Double
+			Dim i = _System_Log_N As Long
 			While i >= 1
-				t = i * x
+				Dim t = (i * x) As Double
 				s = t / (2 + t / (2 * i + 1 + s))
 				i--
 			Wend
-
 			Log = _System_LOG2 * k + x / (1 + s)
 		End If
@@ -249,160 +250,160 @@
 
 	Static Function Log10(x As Double) As Double
-		Return Math.Log(x) / _System_Ln10
-	End Function
-
-	Static Function Max(value1 As Byte,value2 As Byte) As Byte
-		If value1>value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Max(value1 As SByte,value2 As SByte) As SByte
-		If value1>value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Max(value1 As Word,value2 As Word) As Word
-		If value1>value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Max(value1 As Integer,value2 As Integer) As Integer
-		If value1>value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Max(value1 As DWord,value2 As DWord) As DWord
-		If value1>value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Max(value1 As Long,value2 As Long) As Long
-		If value1>value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Max(value1 As QWord,value2 As QWord) As QWord
-		If value1>value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Max(value1 As Int64,value2 As Int64) As Int64
-		If value1>value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Max(value1 As Single,value2 As Single) As Single
-		If value1>value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Max(value1 As Double,value2 As Double) As Double
-		If value1>value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Min(value1 As Byte,value2 As Byte) As Byte
-		If value1<value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Min(value1 As SByte,value2 As SByte) As SByte
-		If value1<value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Min(value1 As Word,value2 As Word) As Word
-		If value1<value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Min(value1 As Integer,value2 As Integer) As Integer
-		If value1<value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Min(value1 As DWord,value2 As DWord) As DWord
-		If value1<value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Min(value1 As Long,value2 As Long) As Long
-		If value1<value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Min(value1 As QWord,value2 As QWord) As QWord
-		If value1<value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Min(value1 As Int64,value2 As Int64) As Int64
-		If value1<value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Min(value1 As Single,value2 As Single) As Single
-		If value1<value2 then
-			return value1
-		Else
-			return value2
-		End If
-	End Function
-
-	Static Function Min(value1 As Double,value2 As Double) As Double
+		Return Math.Log(x) * _System_InverseLn10
+	End Function
+
+	Static Function Max(value1 As Byte, value2 As Byte) As Byte
+		If value1>value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Max(value1 As SByte, value2 As SByte) As SByte
+		If value1>value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Max(value1 As Word, value2 As Word) As Word
+		If value1>value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Max(value1 As Integer, value2 As Integer) As Integer
+		If value1>value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Max(value1 As DWord, value2 As DWord) As DWord
+		If value1>value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Max(value1 As Long, value2 As Long) As Long
+		If value1>value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Max(value1 As QWord, value2 As QWord) As QWord
+		If value1>value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Max(value1 As Int64, value2 As Int64) As Int64
+		If value1>value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Max(value1 As Single, value2 As Single) As Single
+		If value1>value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Max(value1 As Double, value2 As Double) As Double
+		If value1>value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Min(value1 As Byte, value2 As Byte) As Byte
+		If value1<value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Min(value1 As SByte, value2 As SByte) As SByte
+		If value1<value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Min(value1 As Word, value2 As Word) As Word
+		If value1<value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Min(value1 As Integer, value2 As Integer) As Integer
+		If value1<value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Min(value1 As DWord, value2 As DWord) As DWord
+		If value1<value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Min(value1 As Long, value2 As Long) As Long
+		If value1<value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Min(value1 As QWord, value2 As QWord) As QWord
+		If value1<value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Min(value1 As Int64, value2 As Int64) As Int64
+		If value1<value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Min(value1 As Single, value2 As Single) As Single
+		If value1<value2 then
+			return value1
+		Else
+			return value2
+		End If
+	End Function
+
+	Static Function Min(value1 As Double, value2 As Double) As Double
 		If value1<value2 then
 			return value1
@@ -610,5 +611,7 @@
 Const _System_HalfPI = (_System_PI * 0.5)
 Const _System_InverseHalfPI = (2 / _System_PI) '1 / (PI / 2)
-Const _System_Ln10 = 2.3025850929940456840179914546844 '10の自然対数
+Const _System_InverseLn10 = 0.43429448190325182765112891891661 '1 / (ln 10)
+Const _System_InverseSqrt2 = 0.70710678118654752440084436210485 '1 / (√2)
+
 
 #endif '__SYSTEM_MATH_AB__
