This is a quote from the book "The Virtue Of Selfishness" by Ayn Rand
... his body’s welfare or injury, a barometer of its basic alternative, life or death — so the emotional mechanism of man’s consciousness is geared to perform the same function, as a baromete
r that registers the same alternative by means of two basic emotions: joy or suffering. Emotions are the automatic results of man’s value judgments integrated by his subconscious; emotions are
estimates of that which furthers man’s values or threatens them, that which is for him or against him — lightning calculators giving him the sum of his profit or loss.
read full book