guix Posted January 17, 2013 Share Posted January 17, 2013 I try to understand why my function doesn't return the correct result in MTA's Lua In codepad, the correct result: http://codepad.org/9iEiJsW8 In MTA, the exact same function and function calls (only with outputConsole) outputs different results : 1846309504 -931460096 335609632 Any idea why? Can it be because I compiled MTA myself, on a 64bits pc ? I really don't understand and I've searched a solution for 2 days now and I'm tired of searching... PS: I know about tocolor() Edit: I've asked on the Lua IRC and I've been told it's because (MTA's) Lua was compiled to use floats for numbers, and that above 2^24 there is a precision loss, which explain my incorrect results. Can be verified with: if 2^24 == 2^24+1 then outputConsole( "fail" ) end Can this be fixed? Link to comment
DiSaMe Posted January 17, 2013 Share Posted January 17, 2013 It's planned to be fixed: http://bugs.multitheftauto.com/view.php?id=5854 Link to comment
guix Posted January 17, 2013 Author Share Posted January 17, 2013 Indeed, working perfect in a server side script! I hope this will be fixed soon enough, if I could, I would try fix it myself but I have no idea where to start... Link to comment
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