Zedna Posted October 14, 2011 Share Posted October 14, 2011 $n = -1 * 1/1000000 ConsoleWrite("1 = " & $n & @CRLF) ConsoleWrite("2 = " & Round($n,2) & @CRLF) ConsoleWrite("3 = " & StringFormat('%.2f',Round($n,2)) & @CRLF) result 1 = -1e-006 2 = -0 3 = -0.00 it should be 1 = -1e-006 2 = 0 3 = 0.00 I think it's bug in Round(), it shouldn't return -0 as result in any case. Should I create bug ticket for this? Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Bowmore Posted October 14, 2011 Share Posted October 14, 2011 I would not necessarily agree that returning -0 is a bug. whether it is -0 or 0 will make no difference to any subsequent calculations. Having the minus sign does let you know that it has been rounded from a number less than 0. "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
Valik Posted October 14, 2011 Share Posted October 14, 2011 This is not a bug. 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