Its because you are passing integers, so you are getting an integer math result (no floating/decimals, only whole numbers). You'll likely get the right result using the following code:
var test1 = 5.0
var test2 = 10.0
test1 = test1 / test2
print_debug(test1)
Or, another way:
var test1 = 5
var test2 = 10
test1 = float(test1) / test2
print_debug(test1)