>x = ln y / ln 2
This is equivalent to taking the logarithm of "y", to the base 2. However, since most programming languages don't have a built-in function for logarithms in arbitrary bases, you have to use this equivalent.
log_2(x) = ln(x) / ln(2)
where log_2 means logarithm to the base 2; 2 should be written as a subscript.
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)