PartyPooper Posted December 2, 2005 Share Posted December 2, 2005 Just wondering if the Help file shouldn't list Int() in with the Maths Functions rather than in with Variables and Conversions functions especially since Ceiling, Floor and Round are listed as Maths functions. I can understand why IsInt() is listed in with the Variables, just not sure about Int() which I would've considered a maths function. Thoughts? Link to comment Share on other sites More sharing options...
w0uter Posted December 2, 2005 Share Posted December 2, 2005 int typecasts a variable so IMO it should be under variables since it has nothing to do with math My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
PartyPooper Posted December 3, 2005 Author Share Posted December 3, 2005 Yeah, but so does Abs, Round, Floor and Ceiling and they are listed under Maths, so something needs moving IMO. Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted December 3, 2005 Share Posted December 3, 2005 Abs, Round, Floor and Ceiling all have to do with math. How is an absolute value not math related? You can't use it on any other types of variables... Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
PartyPooper Posted December 3, 2005 Author Share Posted December 3, 2005 Abs, Round, Floor and Ceiling all have to do with math. How is an absolute value not math related? You can't use it on any other types of variables...Yes, that's my point. Int is exactly the same - you can't use it on any other types of variable other than numbers (well it can, but it just reports a zero value just as Abs, Round, Floor and Ceiling do).My point is that Int is only useful when related to numbers, therefore, it follows that it belongs under mathematics, not variables. Other languages list INT as a mathematical function, why is AutoIt different? It doesn't make sense to me so I am trying to understand why it's been listed this way. Link to comment Share on other sites More sharing options...
LxP Posted December 3, 2005 Share Posted December 3, 2005 In my opinion Int() is math-related because it truncates the decimal portion of a number. I see no harm in listing it under both categories but I wouldn't remove it from its current location. Link to comment Share on other sites More sharing options...
PartyPooper Posted December 3, 2005 Author Share Posted December 3, 2005 I should have pointed out that I realise INT can be used with strings, however, my understanding is that unless the string contains a number, INT will report a zero value as I would expect it to. In truth, I can see no reason to use INT on a variable unless you're after a mathematical outcome. Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted December 4, 2005 Share Posted December 4, 2005 I was about to note that Int can be used to limit precision of numbers to a certain decimal place, as that is what I have to do to get, in C++, a float to have precision at two decimal places. I just noticed the Round() though. C++: float roundFloat(float input) { float output; output = (int) (input * 100); output = (float) output / 100; return output; } Note: That should work, but I did that in my head quickly, so check it against a compiler before using. Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
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