It doesn't, but I think it should. The string printer (sstr) doesn't
have any precision settings, because it just prints floats at the
precision that they are. But ccode() always prints floats with enough
digits for C. It should be possible to override this, and the
precision option seems like the best way to do this.
The current behavior is also incorrect in another way, which is that
it always uses 17 digits of precision for Float, even though they
default to 15 (also I'm unclear why it is using 17). It should really
be using no more digits than the Float already has. This is even worse
if you explicitly evalf floats to lower than the default 15 digits. If
this worked correctly, you would be able to work around your issue by
simply calling evalf(8) on your expression before calling ccode().
Aaron Meurer
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/8a1174cb-4eb3-4d90-9494-6d2dce5bf622n%40googlegroups.com.