One omission from the formula field reference is the data type that each function returns. You can infer the data type from most formula functions: text, number, or date object.
However, the actual data type for a formula field is determined by the formula as a whole. If any of the final values for a formula field could be text, the formula result will always be text, even if you sometimes want a number.