Re: [Ql-Users] ACOS
Hi, probably rounding errors. a = 1.0009 print a (prints 1) print ACOS (a) gives error in expression. HTH Wolfgang ___ QL-Users Mailing List
Re: [Ql-Users] ACOS
Colin McKay wrote: > A=242641, B=2.828427, C=1.414214. VV=C^2-A^2-B^2/(-2*A*B) A=4.242641 surely. And VV=(C^2-A^2-B^2)/(-2*A*B). > VV calculated, and printed, in QPC2 =1. VV calculated on a calculator > =-24.0071/-24.0071=1. > > Used in QPC2 in RR=ACOS(VV) produces the error message "At line 2345 :1 > error in expression". Works fine here. But these are floating point values and any rounding error might push the value slightly above 1, this is in the nature of things. PRINT will always return a rounded value, so you'll still see only "1". Marcel ___ QL-Users Mailing List
Re: [Ql-Users] ACOS
On 05/30/2016 01:00 PM, Colin McKay wrote: A=242641, B=2.828427, C=1.414214. VV=C^2-A^2-B^2/(-2*A*B) VV calculated, and printed, in QPC2 =1. VV calculated on a calculator =-24.0071/-24.0071=1. I don't get that number, esp. without any ( ) around the first half the the W statement. Can you confirm you typed A in correctly? Tim ___ QL-Users Mailing List
[Ql-Users] ACOS
A=242641, B=2.828427, C=1.414214. VV=C^2-A^2-B^2/(-2*A*B) VV calculated, and printed, in QPC2 =1. VV calculated on a calculator =-24.0071/-24.0071=1. Used in QPC2 in RR=ACOS(VV) produces the error message "At line 2345 :1 error in expression". Change to VV=INT(.), and no error message is produced. Change to VV=INT(.)+1E-10, and no error message is produced. Change to VV=INT(.)+1E-9, and the error message is produced. Alternatively precede RR=ACOS(VV) with IF VV>1 THEN VV=1 together with IF VV<-1 THEN VV-1. Has anyone else experienced this problem? Colin McKay 34 Taylor Avenue Kilbarchan Johnstone Renfrewshire PA10 2LS Tel/fax 01505 70 4471 ___ QL-Users Mailing List