LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Decimal rounding

Highlighted

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
(883 Views)
Highlighted

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.

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2 of 3
(873 Views)
Highlighted

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
Message 3 of 3
(866 Views)