That's why
I GREATLY love ? that B4X supports in-line Jave which gives me full control over the outcome!
Code:
Sub Class_Globals
Private jo As JavaObject = Me ' Needs JavaObject library
End Sub
Code:
#IF JAVA
public static int IntDiv (int a, int b){
int result = a / b; // result will be 7 / 3 = 2 and 4 / 3 = 1
return result;
}
#End If
Code:
Log($"4 / 3 = ${jo.RunMethod("IntDiv", Array(4, 3))}"$)
Log($"7 / 3 = ${jo.RunMethod("IntDiv", Array(7, 3))}"$)
And the magic result :
? All done ???
But seriously, you do have complete control over the processing of the division. If you extend the routine you can determine the accuracy of the division yourself based on the given string format and even theoretically with a Java BIGINTEGER there is no limit to the maximum value.