Data logging math functions