Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Ceilingdoor | |
Old Version | Published before Godot 3 was released. |
That’s it. The following code:
print(2 / 4)
returns 0 but I believe it should return 0.5. My phone’s calculator returns 0.5 as well as the default Windows calculator. So, why does Godot output 0 instead of 0.5?
This standard C code returns the same than Godot:
#include <stdio.h>
int main(void) {
float r= 2/4;
printf("%f", r);
return 0;
}
Output is 0.000000
genete | 2016-03-31 22:20