This is the mail archive of the gcc@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: About GSOC.


On Sun, 9 Jun 2019, Tejas Joshi wrote:

> Hello.
> I have created another patch which addresses the above points,
> attached herewith.

I don't think you should have the unreachable "return false;" in is_even.  
The last "else if" can just be "else".

> > a conditional with < not <=; if REAL_EXP (r) == SIGNIFICAND_BITS, the
> > least significant bit has value 1 and the number must be an integer).
> 
> The number is integer because of the whole word spaces is occupied by
> integer part?
> Also, why would the least significant bit will have value 1 if
> REAL_EXP (r) == SIGNIFICAND_BITS, as it only concerns with 2^0th
> position (even or odd)?

My understanding is that the significand is, as per the comments in 
real.c, in the range [0.5, 1.0).  There are SIGNIFICAND_BITS bits.  The 
bit above the most significant one has value 2^REAL_EXP.  The most 
significant one has value 2^(REAL_EXP-1).  The least significant one has 
value 2^(REAL_EXP-SIGNIFICAND_BITS).  If REAL_EXP == SIGNIFICAND_BITS, 
that means the least significant bit has value 2^0 = 1, and there are no 
bits with value 0.5 or below, so the number is an integer.

-- 
Joseph S. Myers
joseph@codesourcery.com


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