This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: About GSOC.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Tejas Joshi <tejasjoshi9673 at gmail dot com>
- Cc: <gcc at gcc dot gnu dot org>, Martin Jambor <mjambor at suse dot cz>, <hubicka at ucw dot cz>
- Date: Mon, 10 Jun 2019 20:26:26 +0000
- Subject: Re: About GSOC.
- References: <CACMrGjCNdbQ0=cV0kDUdi-DpWp3czxEpSCzPgr13a=Ck9-3=NA@mail.gmail.com> <alpine.DEB.2.21.1905071701330.3445@digraph.polyomino.org.uk> <CACMrGjDFkKzH5Dwahe-yHF6crFLvsR-YQxNv8dJuNn2T=7Zg0g@mail.gmail.com> <CACMrGjBV5PcUU7_yzpko1RrqxGmvMKO8e07mJ5opCLFpJ1pdOg@mail.gmail.com> <CACMrGjC442-jDFG5NLX0R1LpPsz8C2TateF1GC1xTLxQcywsqw@mail.gmail.com> <ri61s0tf7n3.fsf@suse.cz> <alpine.DEB.2.21.1905202143270.19503@digraph.polyomino.org.uk> <CACMrGjB41A2BSPJqGs3ckH+w4xX6iXyc7Kk1siPYFm-TreKWjg@mail.gmail.com> <ri6muj3amzm.fsf@suse.cz> <20190530213839.GF31586@gate.crashing.org> <ri6k1e79bnd.fsf@suse.cz> <CACMrGjAvHE5Bw9M7YYpJC3pkh0cM-SShOzz2sgEm0WPBmGWWUA@mail.gmail.com> <alpine.DEB.2.21.1906031555010.14124@digraph.polyomino.org.uk> <CACMrGjAe0V2ei4A0QJvkEQ+OfT3SrVSdCs-mj_9WWxLButUXWg@mail.gmail.com> <alpine.DEB.2.21.1906061634440.12387@digraph.polyomino.org.uk> <CACMrGjDsg74rFiCgBmrGrEcZEo+TMsz83=uVXZWsUiwuhFFnJQ@mail.gmail.com>
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