added fractions and RNG::trial

This commit is contained in:
2024-07-11 17:28:04 -04:00
parent 6e822ba60a
commit ae5cd1e0c6
6 changed files with 82 additions and 0 deletions

18
src/fraction.h Normal file
View File

@ -0,0 +1,18 @@
#ifndef __FRACTION_H__
#define __FRACTION_H__
struct fraction final {
int numerator;
int denominator;
fraction operator+(const fraction &frac);
fraction operator*(const fraction &frac);
bool operator==(const fraction &frac);
bool operator!=(const fraction &frac);
fraction &simplify();
float real();
private:
int gcd(int a, int b);
};
#endif