Maybe stupid question but ...
BlitzMax Forums/BlitzMax Programming/Maybe stupid question but ...
| ||
Why : In the window calculator 768/512 return 1.5 And under bmax : Print 768/512 return 1 ? |
| ||
TryPrint Float(768)/Float(512) |
| ||
Print 768.0/512.0 returns 1.50000000 its the difference between integer math 768/512 versus floating point maths 768.0/512.0 An integer math produces only integer answers (as 1.5 is a float, so bmax rounded it down to a 1) |
| ||
ok ! many thanks ! Sorry for stupid question ... |
| ||
filax after all this time in blitz you forget something like that :) |
| ||
Lol ! shame on me .... i'm tired at this time ! |
| ||
t'as fumé trop d'herbe l'ami. :) |
| ||
(t'es pas le seule qui parle francais ici, patmaba. Watch what you say :) ) |
| ||
Actually, this still catches me out sometimes today. So, no it's not that stupid, you can quite easily forgot that you haven't declared and int and then get the wrong results. |