On Tue, Oct 8, 2013 at 2:32 PM, Nathan Woods <[email protected]> wrote:
> I'm getting a compiler error using "gcc -c integrand.c".
>
> integrand.c: In function ‘integrand’:
> integrand.c:13:11: error: expected expression before ‘if’
>
> The generated C-code is :
>
> /******************************************************************************
> * Code generated with sympy 0.7.2
> *
> *
> *
> * See http://www.sympy.org/ for more information.
> *
> *
> *
> * This file is part of 'project'
> *
>
> ******************************************************************************/
> #include "integrand.h"
> #include <math.h>
>
> double integrand(double t, double x, double y) {
>
> return if (x < 0.5) {
^^^ I see, obviously the printing of Piecewise() is wrong.
>
> t*x*y + pow(x, 2) + pow(y, 2) + cos(t) - 1
^^^ this is wrong too.
> }
> else if (x >= 0.5) {
> t*x*y + pow(x, 2) + pow(y, 2) + cos(t)
> };
>
> }
I started fixing it here:
https://github.com/sympy/sympy/pull/2524
Ondrej
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.