Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4901

SDK • Re: Lua math issue

$
0
0
I would put it this way, the inherent imprecision of floating point and trig functions necessarily entails asking the question: are the results close enough for the purposes of my application?

DarkElvenAngel, if the purpose of your app is to draw a waveform, and the resulting waveform looks right to you, then it sounds like the answer to that question is yes.

The numeric result that you got for cos(90°) differed from the correct result by about 44 parts per billion. Unless you're also planning to implement zoom-in into a range where values like one ten millionth become visible, no one will ever notice the difference.

Statistics: Posted by slimhazard — Thu Jul 25, 2024 5:33 pm



Viewing all articles
Browse latest Browse all 4901

Trending Articles