Joesavage Posted February 21, 2008 Share Posted February 21, 2008 Hello. I am trying to run a script to add up abunch of numbers. The script works fine. It adds and adds and adds, until it gets to about 30 million. And then all of a sudden, it flips to -70 million. What is going on ? I have tried changing the data type to float, double and decimal. They all have a similar effect. What can i do to make it add it up right? Quote Link to comment https://forums.phpfreaks.com/topic/92222-large-number-flipping-to-negative/ Share on other sites More sharing options...
toplay Posted February 21, 2008 Share Posted February 21, 2008 Show code. Quote Link to comment https://forums.phpfreaks.com/topic/92222-large-number-flipping-to-negative/#findComment-472425 Share on other sites More sharing options...
AndyB Posted February 21, 2008 Share Posted February 21, 2008 http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html http://dev.mysql.com/doc/refman/4.1/en/numeric-type-overview.html Looks as if it should work fine with MySQL 4 or 5. Follow toplay's suggestion. Quote Link to comment https://forums.phpfreaks.com/topic/92222-large-number-flipping-to-negative/#findComment-472428 Share on other sites More sharing options...
Joesavage Posted February 21, 2008 Author Share Posted February 21, 2008 ah damn... some... some moron put in a value of -9999999999. I wonder who that was. Quote Link to comment https://forums.phpfreaks.com/topic/92222-large-number-flipping-to-negative/#findComment-472434 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.