Distributivity and types

"Sanjay Pujare" <sanjayp@ddi.com>
22 May 1999 03:01:25 -0400

          From comp.compilers

Related articles
Distributivity and types sanjayp@ddi.com (Sanjay Pujare) (1999-05-22)
Re: Distributivity and types wclodius@aol.com (1999-05-22)
Re: Distributivity and types adrian@dcs.rhbnc.ac.uk (1999-05-27)
Re: Distributivity and types anton@mips.complang.tuwien.ac.at (1999-05-27)
Re: Distributivity and types adrian@dcs.rhbnc.ac.uk (1999-05-29)
Re: Distributivity and types jonathan_barker@my-deja.com (1999-05-29)
| List of all articles for this month |

From: "Sanjay Pujare" <sanjayp@ddi.com>
Newsgroups: comp.compilers
Date: 22 May 1999 03:01:25 -0400
Organization: Whole Earth Networks News
Keywords: arithmetic, optimize, comment

Hi,


Consider the expression


a*(b+c)


Because of distributivity this can be changed to


a*b+a*c


But I have a question: Can this be done always? What happens when a
is unsigned and (b+c) is signed? Does anybody have any insight into this?


Thanks.


Sanjay
[Depends on your language definition. In Fortran, the answer is always
yes, in other languages, sometimes yes, sometimes no. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.