1. सीखें
  2. /
  3. पाठ्यक्रम
  4. /
  5. Optimizing R Code with Rcpp

Connected

अभ्यास

Error messages

Your C++ functions can contain calls to the stop() function to raise an exception. We've partially defined a function add_positive_numbers() for you. Complete this function to raise exceptions.

निर्देश

100 XP
  • If x is negative, raise an exception with the message: "x is negative".
  • If y is negative, raise an exception with the message: "y is negative".