I have been wondering how the LM317 is able to regulate to a voltage regardless of what voltage is its input (provided that it is higher than the output). Other chips such as the MC34063 require you to calculate the voltage output using the input voltage.