This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: [Patch libfortran/28452] random intrinsics for large reals


On Mon, Jul 31, 2006 at 08:01:56AM +0200, Thomas Koenig wrote:
> +
> +static inline void
> +rnumber_16 (GFC_REAL_16 *f, GFC_UINTEGER_8 v1, GFC_UINTEGER_8 v2)
> +{
> +  GFC_UINTEGER_8 mask;
> +#if GFC_REAL_16_RADIX == 2
> +  mask = ~ (GFC_UINTEGER_8) 0u << (128 - GFC_REAL_16_DIGITS);
> +#elif GFC_REAL_16_RADIX == 16
> +  mask = ~ (GFC_UINTEGER_8) 0u << ((32 - GFC_REAL_16_DIGITS) * 4);
> +#else
> +#error "GFC_REAL_16_RADIX has unknown value"
> +#endif
> +  v2 = v2 & mask;
> +  *f = (GFC_REAL_16) v1 * (GFC_REAL_16) 0x1.p-64
> +    + (GFC_REAL_16) v2 * (GFC_REAL_16) 0x.p-128;

Are you multiply v2 by 0?  I would have expected 0x1.p-128.

-- 
Steve


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