fb:porticula NoPaste
10^310 darstellen
Uploader: | Sebastian |
Datum/Zeit: | 13.02.2008 15:43:29 |
DECLARE FUNCTION ZehnHoch (ByVal Exponent As UInteger, ByVal TsdTrennzeichen As Byte = 0) AS STRING
DIM AS INTEGER Exponent
DIM AS STRING x
CLS
PRINT "10^3 = ";
PRINT ZehnHoch (3,1)
PRINT
PRINT "10^10 = ";
Print ZehnHoch (10,1)
PRINT
PRINT "10^310 = ";
Print ZehnHoch (310,1)
sleep
END
FUNCTION ZehnHoch (ByVal Exponent As UInteger, ByVal TsdTrennzeichen As Byte = 0) AS STRING
DIM AS UINTEGER i, cnt=0
DIM AS STRING temp="1", neu
IF Exponent > 0 THEN temp += STRING(Exponent,48)
IF TsdTrennzeichen <> 0 Then
IF Exponent >= 3 THEN
FOR i = LEN(temp) TO 1 STEP -1
neu = MID(temp,i,1)+neu
cnt+=1
IF cnt = 3 THEN
cnt = 0
IF i > 1 THEN neu = "."+neu
END IF
NEXT i
RETURN neu
ELSE
RETURN temp
END IF
ELSE
RETURN temp
END IF
END FUNCTION