reading internal temperature sensor

This page explains it all : http://arduino.cc/playground/Main/InternalTemperatureSensor

But it is only for ATmega328P types. My Arduino Leonardo has different values, but I haven't yet determined the gain and the offset for the Leonardo.