Index: trunk/ab5.0/ablib/src/basic/function.sbp
===================================================================
--- trunk/ab5.0/ablib/src/basic/function.sbp	(revision 581)
+++ trunk/ab5.0/ablib/src/basic/function.sbp	(revision 589)
@@ -2,78 +2,14 @@
 
 Const _System_PI = 3.14159265358979323846264
-Const _System_LOG2 = 0.6931471805599453094172321214581765680755
 Const _System_SQRT2 = 1.41421356237309504880168872421
-Const _System_Log_N = 7 As Long
 
 '------------- サポート関数の定義 -------------
 
-Function ldexp(x As Double, n As Long) As Double
-	If x = 0 Then
-		ldexp = 0
-		Exit Function
-	End If
-	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
-
-Function frexp(x As Double, ByRef n As Long) As Double
-	If x = 0 Then
-		n = 0
-		frexp = 0
-		Exit Function
-	End If
-
-	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
-End Function
-
-Function frexp(x As Single, ByRef n As Long) As Single
-	If x = 0 Then
-		n = 0
-		frexp = 0
-		Exit Function
-	End If
-
-	Dim pSrc As *DWord, pDest As *DWord
-	pSrc = VarPtr(x) As *DWord
-	pDest = VarPtr(frexp) As *DWord
-	n = ((pSrc[0] >> 23) And &hFF) - 126
-	pDest[0] = (pSrc[0] And &h807FFFFF) Or &h7E000000
-End Function
-
 Function ipow(x As Double, n As Long) As Double
-	Dim abs_n As Long
-	Dim r = 1 As Double
-
-	abs_n=Abs(n) As Long
-	While abs_n<>0
-		If abs_n and 1 Then r *= x
-		x = x * x
-		abs_n >>= 1 ' abs_n \= 2
-	Wend
-
-	If n>=0 Then
-		ipow=r
-	Else
-		ipow=1/r
-	End If
+	ipow = ActiveBasic.Math.pow(x, n)
 End Function
 
 Function pow(x As Double, y As Double) As Double
-'	If -LONG_MAX<=y and y<=LONG_MAX and y=CDbl(Int(y)) Then
-	If y = (y As Long) Then
-		pow = ipow(x, y As Long)
-	ElseIf x>0 Then
-		pow = Exp(y * Log(x))
-		Exit Function
-	ElseIf x<>0 or y<=0 Then
-		pow = ActiveBasic.Math.Detail.GetNaN()
-	Else
-		pow = 0
-	End If
+	pow = ActiveBasic.Math.pow(x, y)
 End Function
 
@@ -89,5 +25,4 @@
 	_System_RndNext = dwSeek
 End Sub
-
 
 '------------- ここからBasic標準関数の定義 -------------
@@ -154,65 +89,65 @@
 '----------
 
-Function Abs(number As Double) As Double
-	'Abs = System.Math.Abs(number)
-	If number < 0 then
-		Abs = -number
-	Else
-		Abs = number
-	End If
-End Function
-
-Function Abs(number As Int64) As Int64
-	If number < 0 then
-		Abs = -number
-	Else
-		Abs = number
-	End If
-End Function
-
-Function Abs(number As Long) As Long
-	If number < 0 then
-		Abs = -number
-	Else
-		Abs = number
-	End If
+/*
+Function Abs(n As Double) As Double
+	Abs = ActiveBasic.Math.Abs(n)
+End Function
+
+Function Abs(n As Single) As Single
+	Abs = ActiveBasic.Math.Abs(n)
+End Function
+
+Function Abs(n As Int64) As Int64
+	Abs = ActiveBasic.Math.Abs(n)
+End Function
+
+Function Abs(n As Long) As Long
+	Abs = ActiveBasic.Math.Abs(n)
+End Function
+
+Function Abs(n As Integer) As Integer
+	Abs = ActiveBasic.Math.Abs(n)
+End Function
+
+Function Abs(n As SByte) As SByte
+	Abs = ActiveBasic.Math.Abs(n)
 End Function
 
 Function Exp(x As Double) As Double
-	Exp = System.Math.Exp(x)
+	Exp = ActiveBasic.Math.Exp(x)
 End Function
 
 Function Log(x As Double) As Double
-	Log = System.Math.Log(x)
-End Function
-
-Function Sgn(number As Double) As Long
-	Sgn = System.Math.Sign(number)
-End Function
-
-Function Sqr(number As Double) As Double
-	Sqr = System.Math.Sqrt(number)
-End Function
-
-Function Atn(number As Double) As Double
-	Atn = System.Math.Atan(number)
+	Log = ActiveBasic.Math.Log(x)
+End Function
+*/
+Function Sgn(n As Double) As Long
+'	Sgn = ActiveBasic..Math.Sign(n)
+End Function
+
+Function Sqr(x As Double) As Double
+	Sqr = ActiveBasic.Math.Sqrt(x)
+End Function
+
+Function Atn(x As Double) As Double
+	Atn = ActiveBasic.Math.Atan(x)
 End Function
 
 Function Atn2(y As Double, x As Double) As Double
-	Atn2 = System.Math.Atan2(y, x)
-End Function
-
-Function Sin(number As Double) As Double
-	Sin = System.Math.Sin(number)
-End Function
-
-Function Cos(number As Double) As Double
-	Cos = System.Math.Cos(number)
-End Function
-
-Function Tan(number As Double) As Double
-	Tan = System.Math.Tan(number)
-End Function
-
+	Atn2 = ActiveBasic.Math.Atan2(y, x)
+End Function
+/*
+Function Sin(x As Double) As Double
+	Sin = ActiveBasic.Math.Sin(x)
+End Function
+
+Function Cos(x As Double) As Double
+	Cos = ActiveBasic.Math.Cos(x)
+End Function
+
+Function Tan(x As Double) As Double
+	Tan = ActiveBasic.Math.Tan(x)
+End Function
+*/
 Const RAND_UNIT = (1.0 / (LONG_MAX + 1.0))
 Function Rnd() As Double
