10/3=3??!!
Blitz3D Forums/Blitz3D Programming/10/3=3??!!| 
 | ||
| Ohhh blitz is being a darling today.  I have just finnished a lib for motionblur on any screen resolution and suddently i found errors... the source of the problem? Apparently 10/3=3 and 0.1+0.1=0 Well, i thought it was just a case of me making the variables non integers... but no that didnt do anything. Is this a problem with the latest version of blitz or am i missing something so stupidly simple? The code i used to test this is below: temp=10/3 print temp waitkey() | 
| 
 | ||
| Common 'mistake' Blitz is performing integer math and therefore returning an integer result (regardless of the variable type). The solution: Just make any of the arguments involved a floating point number: temp# = 10.0 / 3 temp# = 10 / 3.0 temp# = 10.0 / 3.0 or temp# = float(10) / 3 temp# = 10 / float(3) temp# = float(10) / float(3) | 
| 
 | ||
| Well thats what i thought would fix it, but it still returns 3. I am going to reinstall blitz and see if that fixes it. If anyone else has a suggestion, please voice it coz its driving me mad! | 
| 
 | ||
| Ha!! Its the latest release of blitz. I reinstalled and the problem was fixed. | 
| 
 | ||
| You reinstalled which version? | 
| 
 | ||
| Sorry, but I forgot to place the results of the operations above into Floating point variables.  It's now corrected. | 
| 
 | ||
| . | 
| 
 | ||
| . | 
| 
 | ||
| Why's everyone gone dotty? | 
| 
 | ||
| . and . means this: temp = 10.0 / 3.0 print temp waitkey() |