hehe
I told what had to be replaced and what it had to replaced with... oh well
[syntax="QBasic"]DECLARE FUNCTION GetExponent%(Value AS INTEGER, BaseValue AS INTEGER)
'/********************************************************************
' Calculates and returns the integer exponent of BaseValue^x=Value,
' if it exists, in which x is a positive integer number in I.
' Value and BaseValue are required to be postive integer numbers
' Returns -1 if the exponent doesn't exist
' The parameters and return value all span I-positive < 32767
' ********************************************************************/
FUNCTION GetExponent(Value AS INTEGER, BaseValue AS INTEGER)
' /*****************************************************
' Exclude some general mathematical exceptions to LOG
' *****************************************************/
IF BaseValue = 1 AND Value <> 1 THEN
GetExponent = -1: EXIT FUNCTION
ELSEIF (BaseValue = 1 AND Value = 1) OR (BaseValue = 0 AND Value = 0) THEN
GetExponent = 1: EXIT FUNCTION
ELSEIF (Value = 0 AND BaseValue <> 0) THEN
GetExponent = -1: EXIT FUNCTION
END IF
IF BaseValue < 1 OR Value < 0 THEN
GetExponent = -1: EXIT FUNCTION
END IF
'/**********************************
' Calculate the exponent required
' **********************************/
Exponent# = LOG(CDBL(Value)) / LOG(CDBL(BaseValue))
'/**********************************************************
' See if it is an integer exponent and return it if it is
' **********************************************************/
IF Exponent# = INT(Exponent#) THEN
GetExponent = INT(Exponent#)
ELSE
GetExponent = -1
END IF
END FUNCTION[/syntax]