This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] PATCH -- Fix for PR 15619


On Sun, May 30, 2004 at 07:03:55PM +0100, Paul Brook wrote:
> On Sunday 30 May 2004 17:36, Steve Kargl wrote:
> >
> > I also failed to point out that your tweak has invalidated the comments
> > concerning the numerical range of [0,1).  The new numerical range with
> > your code is (0,1].
> 
> The range is [0,1) once the typo is fixed (condition should
> be == 1.0 like the real*4 version).
> 
> >       kiss = kiss_random_kernel ();
> >       *x = (GFC_REAL_4)kiss / (GFC_REAL_4)(~(GFC_UINTEGER_4) 0);
> >
> > kiss falls into the range [1,~(GFC_UINTEGER_4) 0].
> 
> The following seeds give values of 0 and ~0 respectively:
> 
> 0xcffbf6eb, 0x0c2ff953, 0x44e8865d, 0x27ca3f8f
> 0x42b4f81f, 0xf908d0a3, 0x0f41c8c8, 0x3bcd41b3
> 
> So either the documentation or implementation of kiss_random_kernel is 
> incorrect.

The documentation is probably wrong.  I've been searching the web
for a definitive answer.  It seems you've found or computed the
answer.

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]