replace cmath with System::Math