Generic numeric operations class