[Cython] constant folding for floats?

Carl Witty carl.witty at gmail.com
Mon Apr 6 19:24:14 CEST 2009


On Mon, Apr 6, 2009 at 10:15 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Hi,
>
> should we enable constant folding for floats by using the decimal module?

I don't think so.

1) Is there any advantage to doing constant folding in Cython instead
of letting the C compiler do it?

2) If I write a constant floating-point expression, I expect it to be
evaluated according to IEEE rounding rules.  (So I would prefer doing
the constant folding using Python floats, which will usually match the
computations performed in the target, rather than the decimal module,
which won't match the target.)

Carl


More information about the Cython-dev mailing list