increasing_power()
Publié : ven. déc. 28, 2018 3:33 pm
◉ increasing_power(0) [↵]
◉ x^3 - 6*x² + 11*x -6 [↵] returns x^3 - 6*x^2 + 11*x -6
◉ increasing_power() [↵] returns 0
◉ increasing_power(1) [↵]
◉ x^3 - 6*x² + 11*x -6 [↵] retorna -6+11*x-6*x^2+x^3
◉ increasing_power() [↵] returns 0 // must return 1, to determine its status within a program code, although I like it more than to return true/false,
true for 'increasing'
false for 'decreasing'
this gives self-documentation to the code, And closer to natural language, not so computerized.
if increasing_power()==true then ...
although simplified we know that there is no need to make the comparison (==true), it is only for the purpose of showing a more explicit code
◉ x^3 - 6*x² + 11*x -6 [↵] returns x^3 - 6*x^2 + 11*x -6
◉ increasing_power() [↵] returns 0
◉ increasing_power(1) [↵]
◉ x^3 - 6*x² + 11*x -6 [↵] retorna -6+11*x-6*x^2+x^3
◉ increasing_power() [↵] returns 0 // must return 1, to determine its status within a program code, although I like it more than to return true/false,
true for 'increasing'
false for 'decreasing'
this gives self-documentation to the code, And closer to natural language, not so computerized.
if increasing_power()==true then ...
although simplified we know that there is no need to make the comparison (==true), it is only for the purpose of showing a more explicit code