![]() #include // NB: with CJ edits to avoid SdFat/endl conflictĬonst double D2R = DEG_TO_RAD // degrees to radiansĬonst double angle = -66.75828 * D2R // (radians) +ve for Northern hemisphere, -ve for SouthernĬonst double dnum = -1.01234567890123456789 // width:23 precision:20 Looking for clues as to what I am missing? ![]() The best I got was exact equivalence (between MATLAB and teensy) to 8 digits. I figured maybe it was just the output/printing method, so I tested several (including dtostrf). I was expecting (and need) much more accuracy! When I define an angle constant in degrees, convert it to radians and take the tangent the resulting answers are an exact match to 6 decimal places, but they vary in higher precision digits.Įven the initial conversion to radians is similarly 'inaccurate'. ![]() My "equivalent" teensy sketch also uses doubles. I'm developing a teensy sketch and MATLAB script in parallel, but my limited experience with high precision/high accuacy maths has led me following differences in calculated &/or reported values. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |