30 lines
528 B
C
30 lines
528 B
C
#ifndef MATH_UTILS_H
|
|
#define MATH_UTILS_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
// 基础数学运算
|
|
int add(int a, int b);
|
|
int subtract(int a, int b);
|
|
float multiply(float a, float b);
|
|
float divide(float a, float b);
|
|
int fibonacci(int n);
|
|
|
|
// 内存操作
|
|
void *create_buffer(int size);
|
|
void destroy_buffer(void *p);
|
|
|
|
// 数组运算
|
|
int compute_sum(int *arr, int size);
|
|
|
|
// 字符串操作
|
|
const char *get_greeting();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // MATH_UTILS_H
|