A computer implemented method for determining when to change a representation type of at least one number stored in a memory of a data processing system. An operation is received in a processor of the data processing system. The operation references a number stored as a class of an object-oriented programming language. The number is stored as a first representation type. Responsive to the operation being biased towards the first representation type, a first counter is incremented. Responsive to the operation being biased towards a second representation type, a second counter is incremented. A counter reference is equal to a first value of the first counter subtracted from a second value of the second counter. Responsive to the counter reference exceeding a threshold number, representation of a subsequent number is changed from the first representation type to the second representation type.