Floating types in Julia

I have a constant value:

M_LN2 = 0.693147180559945309417

I tried storing it as:

M_LN2 = BigFloat(0.693147180559945309417)

The result seems to be adding too many extra digits:


I tried:

M_LN2 = Float64(0.693147180559945309417)

But it is truncating the value:


Could you suggest what would be the correct way to initialize the constant?

I have posted the question here as well!

It appears your question is answered already on StackOverflow. It’s best to avoid asking the same question at the same time on two different forums, though luckily you posted a link so I could see it’s been answered.