Re: [Rd] identical(0, -0)

2009-08-25 Thread Martin Maechler
HenrikB == Henrik Bengtsson h...@stat.berkeley.edu on Sat, 22 Aug 2009 08:34:51 -0700 writes: HenrikB On Sat, Aug 22, 2009 at 1:22 AM, Petr Savickysavi...@cs.cas.cz wrote: On Sat, Aug 22, 2009 at 12:00:44AM +0200, Martin Maechler wrote: I have taken up the issue now, and

Re: [Rd] identical(0, -0)

2009-08-22 Thread Petr Savicky
On Sat, Aug 22, 2009 at 12:00:44AM +0200, Martin Maechler wrote: I have taken up the issue now, and after thinking, studying the source, trying to define a 'method = string' argument, came to the conclusion that both the implementation and documentation (and source code self-explanation) are

Re: [Rd] identical(0, -0)

2009-08-21 Thread Martin Maechler
I have taken up the issue now, and after thinking, studying the source, trying to define a 'method = string' argument, came to the conclusion that both the implementation and documentation (and source code self-explanation) are easiest to program, maintain, and understand, if I introduce explicit

Re: [Rd] identical(0, -0)

2009-08-12 Thread Martin Maechler
PS == Petr Savicky savi...@cs.cas.cz on Wed, 12 Aug 2009 13:50:46 +0200 writes: PS Let me add the following to the discussion of identical(0, -0). PS I would like to suggest to replace the paragraph PS 'identical' sees 'NaN' as different from 'NA_real_', but all PS 'NaN's

Re: [Rd] identical(0, -0)

2009-08-12 Thread Petr Savicky
On Wed, Aug 12, 2009 at 04:02:28PM +0200, Martin Maechler wrote: PS == Petr Savicky savi...@cs.cas.cz on Wed, 12 Aug 2009 13:50:46 +0200 writes: PS Let me add the following to the discussion of identical(0, -0). PS I would like to suggest to replace the paragraph PS

Re: [Rd] identical(0, -0)

2009-08-11 Thread Martin Maechler
DM == Duncan Murdoch murd...@stats.uwo.ca on Mon, 10 Aug 2009 11:51:53 -0400 writes: DM For people who want to play with these, here are some functions that let DM you get or set the payload value in a NaN. NaN and NA, Inf and -Inf DM are stored quite similarly; these

Re: [Rd] identical(0, -0)

2009-08-11 Thread Petr Savicky
On Tue, Aug 11, 2009 at 10:04:20AM +0200, Martin Maechler wrote: DM == Duncan Murdoch murd...@stats.uwo.ca on Mon, 10 Aug 2009 11:51:53 -0400 writes: DM For people who want to play with these, here are some functions that let DM you get or set the payload value in a NaN.

Re: [Rd] identical(0, -0)

2009-08-10 Thread Petr Savicky
On Sat, Aug 08, 2009 at 10:39:04AM -0400, Prof. John C Nash wrote: I'll save space and not include previous messages. My 2 cents: At the very least the documentation needs a fix. If it is easy to do, then Ted Harding's suggestion of a switch (default OFF) to check for sign difference would

Re: [Rd] identical(0, -0)

2009-08-10 Thread Duncan Murdoch
Petr Savicky wrote: On Sat, Aug 08, 2009 at 10:39:04AM -0400, Prof. John C Nash wrote: I'll save space and not include previous messages. My 2 cents: At the very least the documentation needs a fix. If it is easy to do, then Ted Harding's suggestion of a switch (default OFF) to check for

Re: [Rd] identical(0, -0)

2009-08-10 Thread Simon Urbanek
On Aug 10, 2009, at 5:47 , Duncan Murdoch wrote: Petr Savicky wrote: On Sat, Aug 08, 2009 at 10:39:04AM -0400, Prof. John C Nash wrote: I'll save space and not include previous messages. My 2 cents: At the very least the documentation needs a fix. If it is easy to do, then Ted Harding's

Re: [Rd] identical(0, -0)

2009-08-10 Thread Duncan Murdoch
On 8/10/2009 9:55 AM, Simon Urbanek wrote: On Aug 10, 2009, at 5:47 , Duncan Murdoch wrote: Petr Savicky wrote: On Sat, Aug 08, 2009 at 10:39:04AM -0400, Prof. John C Nash wrote: I'll save space and not include previous messages. My 2 cents: At the very least the documentation needs a fix.

Re: [Rd] identical(0, -0)

2009-08-10 Thread Duncan Murdoch
For people who want to play with these, here are some functions that let you get or set the payload value in a NaN. NaN and NA, Inf and -Inf are stored quite similarly; these functions don't distinguish which of those you're working with. Regular finite values give NA for the payload value,

Re: [Rd] identical(0, -0)

2009-08-10 Thread Petr Savicky
On Mon, Aug 10, 2009 at 05:47:57AM -0400, Duncan Murdoch wrote: I wouldn't mind a strict option. It would compare bit patterns, so would distinguish +0 from -0, and different NaN values. I think that a logical option strict in the above meaning could be useful for debugging. The default may

Re: [Rd] identical(0, -0)

2009-08-08 Thread Martin Maechler
DM == Duncan Murdoch murd...@stats.uwo.ca on Fri, 07 Aug 2009 12:55:50 -0400 writes: DM On 8/7/2009 11:41 AM, Martin Maechler wrote: DM == Duncan Murdoch murd...@stats.uwo.ca on Fri, 07 Aug 2009 11:25:11 -0400 writes: DM On 8/7/2009 10:46 AM, Martin Maechler wrote:

Re: [Rd] identical(0, -0)

2009-08-08 Thread Prof. John C Nash
I'll save space and not include previous messages. My 2 cents: At the very least the documentation needs a fix. If it is easy to do, then Ted Harding's suggestion of a switch (default OFF) to check for sign difference would be sensible. I would urge inclusion in the documentation of the +0,

Re: [Rd] identical(0, -0)

2009-08-08 Thread Gabor Grothendieck
On Sat, Aug 8, 2009 at 10:39 AM, Prof. John C Nashnas...@uottawa.ca wrote: I would urge inclusion in the documentation of the +0, -0 example(s) if there is NOT a way in R to distinguish these. There are occasions where it For single numbers try this: x - +0 y - -0 identical(x, y)

[Rd] identical(0, -0)

2009-08-07 Thread Martin Maechler
William Dunlap wdun...@tibco.com on Thu, 6 Aug 2009 15:06:08 -0700 writes: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Giovanni Petris Sent: Thursday, August 06, 2009 3:00 PM To:

Re: [Rd] identical(0, -0)

2009-08-07 Thread Duncan Murdoch
Martin Maechler wrote: William Dunlap wdun...@tibco.com on Thu, 6 Aug 2009 15:06:08 -0700 writes: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Giovanni Petris Sent: Thursday, August 06,

Re: [Rd] identical(0, -0)

2009-08-07 Thread Ted Harding
On 07-Aug-09 11:07:08, Duncan Murdoch wrote: Martin Maechler wrote: William Dunlap wdun...@tibco.com on Thu, 6 Aug 2009 15:06:08 -0700 writes: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Giovanni

Re: [Rd] identical(0, -0)

2009-08-07 Thread Martin Maechler
TH == Ted Harding ted.hard...@manchester.ac.uk on Fri, 07 Aug 2009 14:49:54 +0100 (BST) writes: TH On 07-Aug-09 11:07:08, Duncan Murdoch wrote: Martin Maechler wrote: William Dunlap wdun...@tibco.com on Thu, 6 Aug 2009 15:06:08 -0700 writes: -Original

Re: [Rd] identical(0, -0)

2009-08-07 Thread Duncan Murdoch
On 8/7/2009 10:46 AM, Martin Maechler wrote: TH == Ted Harding ted.hard...@manchester.ac.uk on Fri, 07 Aug 2009 14:49:54 +0100 (BST) writes: TH On 07-Aug-09 11:07:08, Duncan Murdoch wrote: Martin Maechler wrote: William Dunlap wdun...@tibco.com on Thu, 6 Aug 2009

Re: [Rd] identical(0, -0)

2009-08-07 Thread Martin Maechler
DM == Duncan Murdoch murd...@stats.uwo.ca on Fri, 07 Aug 2009 11:25:11 -0400 writes: DM On 8/7/2009 10:46 AM, Martin Maechler wrote: TH == Ted Harding ted.hard...@manchester.ac.uk on Fri, 07 Aug 2009 14:49:54 +0100 (BST) writes: TH On 07-Aug-09 11:07:08, Duncan

Re: [Rd] identical(0, -0)

2009-08-07 Thread Duncan Murdoch
On 8/7/2009 11:41 AM, Martin Maechler wrote: DM == Duncan Murdoch murd...@stats.uwo.ca on Fri, 07 Aug 2009 11:25:11 -0400 writes: DM On 8/7/2009 10:46 AM, Martin Maechler wrote: TH == Ted Harding ted.hard...@manchester.ac.uk on Fri, 07 Aug 2009 14:49:54 +0100 (BST) writes: