LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Decimal rounding

I'm trying to input the taylor series for a sin(x) in LV, and my answers come out differntly, is there is way to modify the precision on this, i tried doing single precision but solutions do not come out correctly

 

thank you

Download All
0 Kudos
Message 1 of 3
(2,478 Views)

A taylor series is an approximation that gets better with the number of terms.

 

Why do you think you can improve accuracy by going from DBL to SGL? That makes no sense!

 

As a first step, make the code scalable so the number of terms is adjustable. You should also wrap the input into the range of one turn.

 

Here is one of my old implementations. Maybe it can give you some ideas. (originally posted here)

 

 

 

If you are only interested in very few digits, you can change the display format of the indicators.

 

0 Kudos
Message 2 of 3
(2,468 Views)

Most applications use a DBL, which is more accurate than a SGL (Double Precision Floating Point vs a Single Precision Floating Point).  You could go to the EXT (Extended Precision Floating Point), but that won't help you that much.  A Taylor Series will only get you the right answer when you go to infinite number of points in the series.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 3
(2,461 Views)