n3250 Posted August 25, 2012 Posted August 25, 2012 Hi all Sorry for my bad english...I was meet problem, that's Autout count not correctly$CountFrames = 0 $TargetX = 100 $UskX = 2.00 $UskNachX = $UskX*2 $UskNachX = $UskNachX - 0.04 While $CountFrames < 40 $CountFrames = $CountFrames + 1 $UskNachX = $UskNachX - 0.08 $TargetX = $TargetX - $UskNachX IniWrite("log.ini", "log", $CountFrames, $UskNachX) WendLet's see log.iniexpandcollapse popup[log] 1=3.88 2=3.8 3=3.72 4=3.64 5=3.56 6=3.48 7=3.4 8=3.32 9=3.24 10=3.16 11=3.08 12=3 13=2.92 14=2.84 15=2.76 16=2.68 17=2.6 18=2.52 19=2.44 20=2.36 21=2.28 22=2.2 23=2.12 24=2.04 25=1.96 26=1.88 27=1.8 28=1.72 29=1.64 30=1.56 31=1.48 32=1.4 33=1.32 34=1.24 35=1.16 36=1.08 37=0.999999999999997 38=0.919999999999997 39=0.839999999999998 40=0.7599999999999980.999999999999997?? What's i do wrong?I use latest version of Autoit 3.3.8.1
MrMitchell Posted August 25, 2012 Posted August 25, 2012 Maybe you can use the Round() function, like this: $UskNachX = Round($UskNachX - 0.08, 2) Then you end up with this: [log] 1=3.88 2=3.8 3=3.72 4=3.64 5=3.56 6=3.48 7=3.4 8=3.32 9=3.24 10=3.16 11=3.08 12=3 13=2.92 14=2.84 15=2.76 16=2.68 17=2.6 18=2.52 19=2.44 20=2.36 21=2.28 22=2.2 23=2.12 24=2.04 25=1.96 26=1.88 27=1.8 28=1.72 29=1.64 30=1.56 31=1.48 32=1.4 33=1.32 34=1.24 35=1.16 36=1.08 37=1 38=0.92 39=0.84 40=0.76 n3250 1
water Posted August 25, 2012 Posted August 25, 2012 (edited) That's because numbers are stored and processed in binary format. Converting from 10-based format to 2-based leads to inaccuracy.Please search the forum - it has beend discussed a few weeks ago.Edit: Found it. Check this Edited August 25, 2012 by water n3250 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted August 26, 2012 Posted August 26, 2012 Glad to be of service My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now