Add CMath library + ensure it builds, links, and runs
This commit is contained in:
13
Sources/CMath/include/add_nums.h
Normal file
13
Sources/CMath/include/add_nums.h
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// add_nums.h
|
||||
// CMath
|
||||
//
|
||||
// Created by TheAlgorithm476 on 28/03/2025.
|
||||
//
|
||||
|
||||
#ifndef __ADD_NUMS_H
|
||||
#define __ADD_NUMS_H
|
||||
|
||||
double add_nums(double a, double b);
|
||||
|
||||
#endif // __ADD_NUMS_H
|
13
Sources/CMath/include/div_nums.h
Normal file
13
Sources/CMath/include/div_nums.h
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// div_nums.h
|
||||
// CMath
|
||||
//
|
||||
// Created by TheAlgorithm476 on 28/03/2025.
|
||||
//
|
||||
|
||||
#ifndef __DIV_NUMS_H
|
||||
#define __DIV_NUMS_H
|
||||
|
||||
double div_nums(double a, double b);
|
||||
|
||||
#endif // __DIV_NUMS_H
|
13
Sources/CMath/include/mul_nums.h
Normal file
13
Sources/CMath/include/mul_nums.h
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// mul_nums.h
|
||||
// CMath
|
||||
//
|
||||
// Created by TheAlgorithm476 on 28/03/2025.
|
||||
//
|
||||
|
||||
#ifndef __MUL_NUMS_H
|
||||
#define __MUL_NUMS_H
|
||||
|
||||
double mul_nums(double a, double b);
|
||||
|
||||
#endif // __MUL_NUMS_H
|
17
Sources/CMath/include/spc_nums.h
Normal file
17
Sources/CMath/include/spc_nums.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// spc_nums.h
|
||||
// CMath
|
||||
//
|
||||
// Created by TheAlgorithm476 on 28/03/2025.
|
||||
//
|
||||
|
||||
#ifndef __SPC_NUMS_H
|
||||
#define __SPC_NUMS_H
|
||||
|
||||
#define POOR_MANS_POW_GUESSES 12
|
||||
#define NEWTONIAN_DIV_GUESSES 12
|
||||
|
||||
double pow(double x, double exp);
|
||||
double sqrt(double x);
|
||||
|
||||
#endif // __SPC_NUMS_H
|
13
Sources/CMath/include/sub_nums.h
Normal file
13
Sources/CMath/include/sub_nums.h
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// sub_nums.h
|
||||
// CMath
|
||||
//
|
||||
// Created by TheAlgorithm476 on 28/03/2025.
|
||||
//
|
||||
|
||||
#ifndef __SUB_NUMS_H
|
||||
#define __SUB_NUMS_H
|
||||
|
||||
double sub_nums(double a, double b);
|
||||
|
||||
#endif // __SUB_NUMS_H
|
BIN
Sources/CMath/lib/libcmath.so
Executable file
BIN
Sources/CMath/lib/libcmath.so
Executable file
Binary file not shown.
9
Sources/CMath/module.modulemap
Normal file
9
Sources/CMath/module.modulemap
Normal file
@@ -0,0 +1,9 @@
|
||||
module CMath {
|
||||
header "include/add_nums.h"
|
||||
header "include/sub_nums.h"
|
||||
header "include/mul_nums.h"
|
||||
header "include/div_nums.h"
|
||||
header "include/spc_nums.h"
|
||||
export *
|
||||
link "cmath"
|
||||
}
|
@@ -2,6 +2,7 @@
|
||||
// https://docs.swift.org/swift-book
|
||||
|
||||
import Adwaita
|
||||
import CMath
|
||||
|
||||
@main
|
||||
struct PMCalc: App {
|
Reference in New Issue
Block a user