On Mon, Nov 17, 2008 at 4:28 PM, Vadas <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm new to Sympy but find it really useful.  I mainly use it to

Thanks for your interest, nice to hear it.

> generate symbolic expressions for use as C/C++ code (I need the speed
> of C).  Everything works nicely except raising to an exponent, i.e. C
> doesn't understand
>
> a**b
>
> and needs
>
> pow(a,b)
>
> I've been looking through the documentation and some of the code but I
> don't see a way to force Sympy to print exponents using pow().  For
> simple expressions it is not a big deal to write a script to fix the
> output but for complicated ones it is a nightmare.  Since Sympy uses
> pow(a,b) under the hood, is there some way to force it to print this
> way?

Absolutely:

In [1]: var("a b")
Out[1]: (a, b)

In [2]: ccode(a**b)
Out[2]: 'pow(a,b)'

But you need to use our git version. I hope to realease it really soon.

Ondrej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to