C
create
Guest
Hello,
there are two functions for logarithms in PACKAGE MATH_REAL:
function LOG (X : real ) return real;
-- returns natural logarithm of X; X > 0
function LOG (BASE: positive; X : real) return real;
-- returns logarithm base BASE of X; X > 0In my project i used
first:constant CONST_LOG_NUMBER_SAMPLES : Natural :=
Natural(ceil(LOG(realCONST_NUMBER_SAMPLES))));
and it is correct.But I can not make second version:constant
CONST_LOG_NUMBER_SAMPLES : Natural :=
Natural(ceil(LOG(2,real(CONST_NUMBER_SAMPLES))));ORconstant
CONST_LOG_NUMBER_SAMPLES : Natural :=
Natural(ceil(LOG(real(2),real(CONST_NUMBER_SAMPLES))));How should I write
LOG with base = 2?Thanks,Create
there are two functions for logarithms in PACKAGE MATH_REAL:
function LOG (X : real ) return real;
-- returns natural logarithm of X; X > 0
function LOG (BASE: positive; X : real) return real;
-- returns logarithm base BASE of X; X > 0In my project i used
first:constant CONST_LOG_NUMBER_SAMPLES : Natural :=
Natural(ceil(LOG(realCONST_NUMBER_SAMPLES))));
and it is correct.But I can not make second version:constant
CONST_LOG_NUMBER_SAMPLES : Natural :=
Natural(ceil(LOG(2,real(CONST_NUMBER_SAMPLES))));ORconstant
CONST_LOG_NUMBER_SAMPLES : Natural :=
Natural(ceil(LOG(real(2),real(CONST_NUMBER_SAMPLES))));How should I write
LOG with base = 2?Thanks,Create