When using LOG in visualG a problem is occurring, I need to split a value entered by the user, by log 2 in base 10. But he does not do this error.
funcao menu_8():inteiro
var
logaritmo :real
inicio
para contador de 0 ate 12 faca
logaritmo <- ((log(i[contador])) / (log(2)))
se ((logaritmo % 2 = 0) OU (logaritmo % 2 = 1)) entao
escreva(" é Potencia de 2: ", i[contador])
fimse
fimpara
escreval(" ")
fimfuncao
After the SE function is executed and the result of the division is an integer value, without a comma, it prints the message, otherwise it makes the loop of repetition with another value of the vector, until it finds a number that is power of 2, if none, then it goes out and does not print anything.
What is the easiest way to resolve this?