The documentation (https://docs.sympy.org/latest/modules/printing.html) 
says the precision parameter is for "numbers such as pi" so I wasn't sure 
if it applied to certain constants or any floating point values.

On Wednesday, December 16, 2020 at 4:11:43 PM UTC-5 [email protected] wrote:

> This looks like a bug. The precision parameter is being ignored.
>
> Aaron Meurer
>
> On Wed, Dec 16, 2020 at 11:51 AM [email protected]
> <[email protected]> wrote:
> >
> > Hi -
> >
> > Is it possible to set the precision of printed floating point values 
> when using ccode, cxxcode, etc? Using the 'precision' parameter does not 
> seem to do anything.
> >
> > For instance, the following:
> > T = sym.Symbol('T')
> > f = 0.00437791*T**2
> > print(sym.cxxcode(f, precision=8))
> >
> > produces:
> >
> > 0.0043779099999999996*std::pow(T, 2)
> >
> > Thanks.
> >
> > - Jesse
> >
> >
> > --
> > 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/adfc7377-602e-4442-b5c3-aebd3d2c529dn%40googlegroups.com
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/8a1174cb-4eb3-4d90-9494-6d2dce5bf622n%40googlegroups.com.

Reply via email to