[Rd] abs() and negative output from fractions() (PR#3536)

Luke Tierney luke at stat.uiowa.edu
Wed Jul 23 07:12:14 MEST 2003


DispatchGroup was not using R_LookupMethod for the group generic;
should be fixed in R-devel now.

luke

On Wed, 23 Jul 2003, Prof Brian Ripley wrote:

> Something seems wrong in the way the group generics are registered, as 
> they are not being called.  As a workaround, add
> 
> export(Math.fractions,Ops.fractions,Summary.fractions)
> 
> to library/MASS/NAMESPACE and the examples seem to work again.
> 
> On Wed, 23 Jul 2003, Barry Rowlingson wrote:
> 
> > Prof Brian Ripley wrote:
> > > On Tue, 22 Jul 2003, Duncan Murdoch wrote:
> > 
> > > This is not even a VR bug: no one said abs() is implemented for fractions, 
> > > and it is not.  From the help page:
> > > 
> > >      Arithmetic operations on `"fractions"' objects are possible.
> > > 
> > > and abs() is not such an operation.
> > > 
> > 
> >   Something funny is happening with printing fractions - the values seem 
> > correct under abs() [and other functions]:
> > 
> >  > xf
> > [1]    2 -2/5  2/5  2/3
> >  > abs(xf)
> > [1]    2 -2/5  2/5  2/3
> >  > abs(xf)[2]
> > [1] 2/5
> > 
> >   huh?
> > 
> >  > sqrt(xf)
> > [1]    2 -2/5  2/5  2/3
> > Warning message:
> > NaNs produced in: sqrt(xf)
> > 
> >  > sqrt(xf)[1:4]
> > [1]   8119/5741         NaN     191/302 38804/47525
> > Warning message:
> > NaNs produced in: sqrt(xf)
> > 
> >   Bug, undocumented behaviour, feature? I dont know. It all seems to 
> > work in 1.6.0, so everyone should downgrade now... :)
> > 
> > Baz
> > 
> > ______________________________________________
> > R-devel at stat.math.ethz.ch mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-devel
> > 
> 
> 

-- 
Luke Tierney
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
   Actuarial Science
241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu



More information about the R-devel mailing list