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/ Link to comment https://forums.phpfreaks.com/topic/7649-solved-floating-numbers-question/ 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] Link to comment https://forums.phpfreaks.com/topic/7649-solved-floating-numbers-question/#findComment-27881 Share on other sites More sharing options...
Ninjakreborn Posted April 17, 2006 Author Share Posted April 17, 2006 thanks I appreciate it, Link to comment https://forums.phpfreaks.com/topic/7649-solved-floating-numbers-question/#findComment-27886 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.