MySQL 9.1.0
Source Code Documentation
simple_example_math_imp Class Reference

A simple implementation of basic math example Service. More...

#include <simple_example_math_imp.h>

Static Public Member Functions

static mysql_service_status_t calculate_gcd (int a, int b, int *result) noexcept
 Calculates Greatest Common Divisor for given two non-negative numbers. More...
 

Detailed Description

A simple implementation of basic math example Service.

Member Function Documentation

◆ calculate_gcd()

mysql_service_status_t simple_example_math_imp::calculate_gcd ( int  a,
int  b,
int *  result 
)
staticnoexcept

Calculates Greatest Common Divisor for given two non-negative numbers.

Uses recursive algorithm to calculate result.

Parameters
aFirst number to calculate GCD of.
bSecond number to calculate GCD of.
[out]resultA pointer to integer variable to store result in.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

The documentation for this class was generated from the following files: