Ninjakreborn Posted April 17, 2006 Share Posted April 17, 2006 What does this paragraph mean exactly in relation to php, why is this so, and what do I need to look out for, this was quoted from www.hudzilla.org."You should be aware that floating-point numbers are complicated beasts, and are unpredictable. The classic example is the sum "(0.1+0.7)*10" converted to an integer. You might think, "that's easy - it's 8", but PHP will report 7. The reason for this is because inherent inconsistencies in floating-point numbers mean that the value will actually be 7.9999999999999991. Usually this is not a problem, because rounding that value even to 10 decimal places gives you 8, however it does mean that you should avoid comparing floating-point numbers wherever possible"Thanks/ Quote Link to comment Share on other sites More sharing options...
Barand Posted April 17, 2006 Share Posted April 17, 2006 See[a href=\"http://www.phpfreaks.com/forums/index.php?s=&showtopic=90072&view=findpost&p=361391\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...ndpost&p=361391[/a] Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted April 17, 2006 Author Share Posted April 17, 2006 thanks I appreciate it, Quote Link to comment 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.