Rename the project from "MyLibrary" to "MedicalLib" to better reflect its intended purpose as a library for medical simulations.
- Rename all files, directories, and internal project names to "MedicalLib". - Replace the generic `add` function with a more domain-specific `calculateBMI` function as an initial example of the library's capabilities. - Update the `AGENTS.md` file to describe the new purpose and scope of the MedicalLib library.
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
#include "Library.h"
|
||||
|
||||
int add(int a, int b) {
|
||||
return a + b;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// Define MY_LIB_EXPORT for exporting symbols from the DLL
|
||||
#if defined(_WIN32)
|
||||
#if defined(MY_LIB_EXPORT)
|
||||
#define MY_LIB_API __declspec(dllexport)
|
||||
#else
|
||||
#define MY_LIB_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define MY_LIB_API
|
||||
#endif
|
||||
|
||||
// A simple function to be exported
|
||||
MY_LIB_API int add(int a, int b);
|
||||
@@ -0,0 +1,12 @@
|
||||
#include "MedicalLib/MedicalLib.h"
|
||||
#include <stdexcept>
|
||||
|
||||
double calculateBMI(double weight_kg, double height_m) {
|
||||
if (height_m <= 0) {
|
||||
throw std::invalid_argument("Height must be positive.");
|
||||
}
|
||||
if (weight_kg <= 0) {
|
||||
throw std::invalid_argument("Weight must be positive.");
|
||||
}
|
||||
return weight_kg / (height_m * height_m);
|
||||
}
|
||||
Reference in New Issue
Block a user