Returns the absolute value of n - mid * mid * mid
< ? php function diff ( $ n , $ mid ) { if ( $ n > ( $ mid * $ mid * $ mid ) ) return ( $ n - ( $ mid * $ mid * $ mid ) ) ; else return ( ( $ mid * $ mid * $ mid ) - $ n ) ; }