Mathematical utilities