Início > lang > log 
 en fr de es it nl pl pt mk sq ca hu cs tr ar fa id vi ko ja ru zh zh_TW eo
Anterior  Próximo  Editar  Renomear  Desfazer  Procurar  Administração  
Documentação  
Cuidado! Esta página não está traduziada.  Veja a versão em inglês 
Log
Value = Log ( Number AS Float )

Computes natural logarithm of a number i.e. logarithm to base e, where e is an irrational constant approximately equal to 2.71828. The number must be greater than zero. It cannot be negative or zero.

Gambas has built-in functions to calculate base-2 and base-10 logarithm.

To calculate base-n logarithms the following relation can be used: Logn(x) = Log(x) / Log(n)

Erros

MensagemDescrição
Erro matemático ( Number is negative or zero.

Exemplo

PRINT Log(2.71828)

0.999999327347

DIM i AS INTEGER
FOR i = 1 TO 50 STEP 10
  PRINT i, Log(i)
NEXT

1    0
11   2.397895272798
21   3.044522437723
31   3.433987204485
41   3.713572066704

Veja também

Funções Logarítmicas e Exponenciais