... assuming that mpfr is using the exact value of the double precision ...It is - unless there's a bug at work.
which makes d = 58Here's a couple of values that, according to mpfr, require 60 decimal digits:
1 / 526
1.90114068441064637711435114653113487293012440204620361328125e-3
1 / 535
1.86915887850467297461032334382480257772840559482574462890625e-3
Might be time I stopped fiddling and started thinking. (Have you got a spare one of those in-skull emulators that you could send over ?)
Update: Fiddling is much easier, especially on a Sat'dy night. I've found numerous doubles that apparently require 122 decimal digits for exact representation, but haven't found any that require more than 122. For example:
25 / (8360484 ** 15)
3.66833261843476555514935702258199343058161821865425601769198458144384
+41059633175331427349000780680559003454762069283595612e-103
Cheers, Rob
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|