Displaying 6 results from an estimated 6 matches for "hexnumeric".
2020 Mar 02
2
dput()
...ating point number?". Duncan's
> > reply is the insight I was missing: exact decimal
> > representation of a double might not be possible (this had
> > not occurred to me). Also, Duncan's suggestion of control
> > = c("all", "hexNumeric") looks good and I will experiment
> > with this.
>
> This was not Duncan's suggestion but rather Duncan's *citation* :
> Note that he used " .... " !
>
> The citation is from ?deparseOpts (to which one is pointed when reading ?dput),
> <...
2020 Feb 29
2
dput()
...w to
force dput() to return an exact representation of a floating point
number?". Duncan's reply is the insight I was missing: exact decimal
representation of a double might not be possible (this had not
occurred to me). Also, Duncan's suggestion of control = c("all",
"hexNumeric") looks good and I will experiment with this.
Best wishes
Robin
On Sun, Mar 1, 2020 at 6:22 AM Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>
> On 29/02/2020 4:19 a.m., Ben Bolker wrote:
> >
> > I think Robin knows about FAQ 7.31/floating point (author of...
2020 Mar 02
0
dput()
...representation of a floating point number?". Duncan's
> reply is the insight I was missing: exact decimal
> representation of a double might not be possible (this had
> not occurred to me). Also, Duncan's suggestion of control
> = c("all", "hexNumeric") looks good and I will experiment
> with this.
This was not Duncan's suggestion but rather Duncan's *citation* :
Note that he used " .... " !
The citation is from ?deparseOpts (to which one is pointed when reading ?dput),
<rant>
but unfortunately many peop...
2020 Mar 02
0
dput()
...number?". Duncan's
>> > reply is the insight I was missing: exact decimal
>> > representation of a double might not be possible (this had
>> > not occurred to me). Also, Duncan's suggestion of control
>> > = c("all", "hexNumeric") looks good and I will experiment
>> > with this.
>>
>> This was not Duncan's suggestion but rather Duncan's *citation* :
>> Note that he used " .... " !
>>
>> The citation is from ?deparseOpts (to which on...
2020 Feb 29
3
dput()
I think Robin knows about FAQ 7.31/floating point (author of
'Brobdingnag', among other numerical packages). I agree that this is
surprising (to me).
To reframe this question: is there way to get an *exact* ASCII
representation of a numeric value (i.e., guaranteeing the restored value
is identical() to the original) ?
.deparseOpts has
?"digits17"?: Real and finite complex
2020 Feb 29
0
dput()
...may give more precision than the
> default (but the output will depend on the platform and there
> may be loss of precision when read back).
>
> ... but this still doesn't guarantee that all precision is kept.
"Using control = c("all", "hexNumeric") comes closest to making
deparse() an inverse of parse(), as representing double and complex
numbers as decimals may well not be exact. However, not all objects are
deparse-able even with this option. A warning will be issued if the
function recognizes that it is being asked to do the imp...