w0uter 4 Posted June 8, 2005 what is the difference between the: BUILD IN UDF and the BUILD IN FUNC _Floor and Floor _Ceil and Ceiling My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Share this post Link to post Share on other sites
Nutster 3 Posted June 9, 2005 (edited) 1) I was not aware of the UDF's prior to writing the built-ins. (Yes, I am the idiot that wrote the built-in functions. ) 2) Floor() and Ceiling() directly call standard C functions, instead of working around in AutoIt. This makes the built-in functions much faster and easier on the system from the UDF's. I would recommend that if you are going to be using the beta, use Floor() and Ceiling(), but if your code could be run on the release version, use the UDF's (for now). Edit: Stupid speeling errors! Edited June 11, 2005 by Nutster David NuttallNuttall Computer ConsultingAn Aquarius born during the Age of AquariusAutoIt allows me to re-invent the wheel so much faster.I'm off to write a wizard, a wonderful wizard of odd... Share this post Link to post Share on other sites
w0uter 4 Posted June 9, 2005 so the udf _floor & _ceil will be removed on the next beta release ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Share this post Link to post Share on other sites
Nutster 3 Posted June 9, 2005 Continuing the thread started here, Int, Round, Ceiling and Floor have related but different behaviours.Int truncates decimals, giving a result that is closer to 0, or the same if no decimals.Int(4.8) = 4 Int(4.5) = 4 Int(4.3) = 4 Int(4) = 4 Int(-4) = -4 Int(-4.3) = -4 Int(-4.5) = -4 Int(-4.8) = -4Round rounds to the nearest integer (or whatever scale you give).Round(4.8) = 5 Round(4.5) = 5 Round(4.3) = 4 Round(4) = 4 Round(-4) = -4 Round(-4.3) = -4 Round(-4.5) = -5 Round(-4.8) = -5Floor always rounds down. The number returned is the largest integer less than or equal to the parameter.Floor(4.8) = 4 Floor(4.5) = 4 Floor(4.3) = 4 Floor(4) = 4 Floor(-4) = -4 Floor(-4.3) = -5 Floor(-4.5) = -5 Floor(-4.8) = -5Ceiling always rounds up. The number returned is the smallest integer greater than or equal to the parameter.Ceiling(4.8) = 5 Ceiling(4.5) = 5 Ceiling(4.3) = 5 Ceiling(4) = 4 Ceiling(-4) = -4 Ceiling(-4.3) = -4 Ceiling(-4.5) = -4 Ceiling(-4.8) = -4Keep in mind that negative numbers are reversed in order from positive numbers.So, -4 > -4.3 David NuttallNuttall Computer ConsultingAn Aquarius born during the Age of AquariusAutoIt allows me to re-invent the wheel so much faster.I'm off to write a wizard, a wonderful wizard of odd... Share this post Link to post Share on other sites
therks 31 Posted June 9, 2005 Wow.. I feel pretty foolish right now. See, what I saw in the post update for .44, that Ceil and Floor functions were included, I checked my help file (which HADN'T been updated yet) and saw the _Ceil, and _Floor UDFs (which I had not noticed before), so when I tried them, that's when I came up with erroneous results, hence my post on the beta thread saying that Ceil was faulty... No wonder nobody addressed my concern, I was wrong! If I could delete those posts, I would. My AutoIt Stuff | My Github Share this post Link to post Share on other sites
Nutster 3 Posted June 11, 2005 so the udf _floor & _ceil will be removed on the next beta release ?<{POST_SNAPBACK}>More likely the next official release. David NuttallNuttall Computer ConsultingAn Aquarius born during the Age of AquariusAutoIt allows me to re-invent the wheel so much faster.I'm off to write a wizard, a wonderful wizard of odd... Share this post Link to post Share on other sites
Jos 2,164 Posted June 11, 2005 so the udf _floor & _ceil will be removed on the next beta release ?<{POST_SNAPBACK}>More likely the next official release.<{POST_SNAPBACK}>Nah, don't think we should remove it yet for backwards compatibility.But will remove it from the Helpfile when this release becomes official. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
Nutster 3 Posted June 11, 2005 Nah, don't think we should remove it yet for backwards compatibility.But will remove it from the Helpfile when this release becomes official. <{POST_SNAPBACK}>Works for me. David NuttallNuttall Computer ConsultingAn Aquarius born during the Age of AquariusAutoIt allows me to re-invent the wheel so much faster.I'm off to write a wizard, a wonderful wizard of odd... Share this post Link to post Share on other sites