Index: Include/Classes/System/Math.ab
===================================================================
--- Include/Classes/System/Math.ab	(revision 257)
+++ Include/Classes/System/Math.ab	(revision 268)
@@ -1,6 +1,10 @@
 ' Classes/System/Math.ab
+
+#require <Classes/ActiveBasic/Math/Math.ab>
 
 #ifndef __SYSTEM_MATH_AB__
 #define __SYSTEM_MATH_AB__
+
+Namespace System
 
 Class Math
@@ -56,5 +60,5 @@
 	Static Function Acos(x As Double) As Double
 		If x < -1 Or x > 1 Then
-			Acos = _System_GetNaN()
+			Acos = ActiveBasic.Math.Detail.GetNaN()
 		Else
 			Acos = _System_HalfPI - Asin(x)
@@ -64,5 +68,5 @@
 	Static Function Asin(x As Double) As Double
 		If x < -1 Or x > 1 Then
-			Asin = _System_GetNaN()
+			Asin = ActiveBasic.Math.Detail.GetNaN()
 		Else
 			Asin = Math.Atan(x / Sqrt(1 - x * x))
@@ -71,9 +75,9 @@
 
 	Static Function Atan(x As Double) As Double
-		If IsNaN(x) Then
+		If ActiveBasic.Math.IsNaN(x) Then
 			Atan = x
 			Exit Function
-		ElseIf IsInf(x) Then
-			Atan = CopySign(_System_PI, x)
+		ElseIf ActiveBasic.Math.IsInf(x) Then
+			Atan = ActiveBasic.Math.CopySign(_System_PI, x)
 			Exit Function
 		End If
@@ -113,5 +117,5 @@
 			Atan2 = Atn(y / x)
 			If x < 0 Then
-				Atan2 += CopySign(_System_PI, y)
+				Atan2 += ActiveBasic.Math.CopySign(_System_PI, y)
 			End If
 		End If
@@ -131,8 +135,8 @@
 
 	Static Function Cos(x As Double) As Double
-		If IsNaN(x) Then
+		If ActiveBasic.Math.IsNaN(x) Then
 			Return x
-		ElseIf IsInf(x) Then
-			Return _System_GetNaN()
+		ElseIf ActiveBasic.Math.IsInf(x) Then
+			Return ActiveBasic.Math.Detail.GetNaN()
 		End If
 
@@ -159,7 +163,7 @@
 
 	Static Function Exp(x As Double) As Double
-		If IsNaN(x) Then
+		If ActiveBasic.Math.IsNaN(x) Then
 			Return x
-		Else If IsInf(x) Then
+		Else If ActiveBasic.Math.IsInf(x) Then
 			If 0 > x Then
 				Return 0
@@ -200,5 +204,5 @@
 
 	Static Function IEEERemainder(x As Double, y As Double) As Double
-		If y = 0 Then Return _System_GetNaN()
+		If y = 0 Then Return ActiveBasic.Math.Detail.GetNaN()
 		Dim q = x / y
 		If q <> Int(q) Then
@@ -224,8 +228,8 @@
 	Static Function Log(x As Double) As Double
 		If x = 0 Then
-			Log = _System_GetInf(True)
-		ElseIf x < 0 Or IsNaN(x) Then
-			Log = _System_GetNaN()
-		ElseIf IsInf(x) Then
+			Log = ActiveBasic.Math.Detail.GetInf(True)
+		ElseIf x < 0 Or ActiveBasic.Math.IsNaN(x) Then
+			Log = ActiveBasic.Math.Detail.GetNaN()
+		ElseIf ActiveBasic.Math.IsInf(x) Then
 			Log = x
 		Else
@@ -236,5 +240,5 @@
 			SetQWord(p, m + &h0010000000000000)
 			x /= tmp
-			Log = _System_LOG2 * k + _System_Log1p(x - 1)
+			Log = _System_LOG2 * k + ActiveBasic.Math.Detail.Log1p(x - 1)
 		End If
 	End Function
@@ -481,8 +485,8 @@
 
 	Static Function Sin(value As Double) As Double
-		If IsNaN(value) Then
+		If ActiveBasic.Math.IsNaN(value) Then
 			Return value
-		ElseIf IsInf(value) Then
-			Return _System_GetNaN()
+		ElseIf ActiveBasic.Math.IsInf(value) Then
+			Return ActiveBasic.Math.Detail.GetNaN()
 			Exit Function
 		End If
@@ -514,5 +518,5 @@
 		Dim i As *Word, j As Long, jj As Long, k As Long
 		If x > 0 Then
-			If IsInf(x) Then
+			If ActiveBasic.Math.IsInf(x) Then
 				Sqrt = x
 			Else
@@ -530,5 +534,5 @@
 			End If
 		ElseIf x < 0 Then
-			Sqrt = _System_GetNaN()
+			Sqrt = ActiveBasic.Math.Detail.GetNaN()
 		Else
 			'x = 0 Or NaN
@@ -538,9 +542,9 @@
 
 	Static Function Tan(x As Double) As Double
-		If IsNaN(x) Then
+		If ActiveBasic.Math.IsNaN(x) Then
 			Tan = x
 			Exit Function
-		ElseIf IsInf(x) Then
-			Tan = _System_GetNaN()
+		ElseIf ActiveBasic.Math.IsInf(x) Then
+			Tan = ActiveBasic.Math.Detail.GetNaN()
 			Exit Function
 		End If
@@ -554,5 +558,5 @@
 			Return -1 / t
 		Else
-			Return CopySign(_System_GetInf(FALSE), -t)
+			Return ActiveBasic.Math.CopySign(ActiveBasic.Math.Detail.GetInf(False), -t)
 		End If
 	End Function
@@ -599,4 +603,6 @@
 End Class
 
+End Namespace
+
 Const _System_HalfPI = (_System_PI * 0.5)
 Const _System_InverseHalfPI = (2 / _System_PI) '1 / (PI / 2)
@@ -604,4 +610,3 @@
 Const _System_InverseSqrt2 = 0.70710678118654752440084436210485 '1 / (√2)
 
-
 #endif '__SYSTEM_MATH_AB__
