Here you can find the source of truncate(int a, int b)
public static int[] truncate(int a, int b)
//package com.java2s; //License from project: Open Source License public class Main { public static int[] truncate(int a, int b) { int quo = a / b; return new int[] { quo, a - (quo * b) }; }// www . ja v a2 s.c o m public static long[] truncate(long a, long b) { long quo = a / b; return new long[] { quo, a - (quo * b) }; } }