Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program to calculate the logarithm (log 10) of a number > 1
#4
CLS
'Version 2.0 Ok!!!

'Este programa calcula el logaritmo (log10)
'de un numero entre 1 ... 999999999
'lrcvs 26.09.08
INPUT "Logaritmo de un numero > 1 : "; n$
INPUT "Precision ( 1...5) : "; p
PRINT "Solutions ( comparatives ):"
PRINT
x5# = LOG(VAL(n$)) / LOG(10#)
LOCATE 5, 1: PRINT "Solution of computer  = "; x5#
i = LEN(n$) - 1
j = i + 1
FOR b# = i TO j STEP 1 / (10 ^ p)
l# = 10 ^ b#
IF l# = VAL(n$) THEN CLS : PRINT "El (log 10 = ) de "; n$; " es = "; b#: GOTO 10
IF l# > VAL(n$) THEN LOCATE 6, 1: PRINT "Value by MAX of "; n$; " is = "; b#: x1# = b#: GOTO 10
NEXT b#
10 :
PRINT
l# = 0
FOR w# = i TO j STEP 1 / (10 ^ p)
l# = 10 ^ w#
IF l# < VAL(n$) THEN LOCATE 7, 1: PRINT "Value by MIN of "; n$; " is = "; w#: x2# = w#
NEXT w#
x3# = (x1# + x2#) / 2
LOCATE 8, 1: PRINT "Value average          = "; x3#
Reply


Messages In This Thread
Re: Program to calculate the logarithm (log 10) of a number > 1 Ver:2.001 Ax - by lrcvs - 09-28-2008, 10:38 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)