mirror of
https://git.gfz-potsdam.de/naaice/tug.git
synced 2025-12-15 18:38:23 +01:00
35 lines
661 B
C++
35 lines
661 B
C++
#include "tug/Datatypes/FixedPoint.hpp"
|
|
|
|
#include <cstdint>
|
|
#include <iostream>
|
|
|
|
using namespace tug;
|
|
|
|
using FPToTest = Fixed8<5>;
|
|
|
|
int main() {
|
|
FPToTest with(1.5);
|
|
FPToTest without(0.5);
|
|
|
|
const int test = 0;
|
|
|
|
const FPToTest lol = 0;
|
|
|
|
if (lol == test) {
|
|
std::cout << "This works\n";
|
|
}
|
|
|
|
double operation;
|
|
|
|
operation = with + without;
|
|
std::cout << "Addition: " << operation << std::endl;
|
|
|
|
operation = with - without;
|
|
std::cout << "Subtraction: " << operation << std::endl;
|
|
|
|
operation = with * without;
|
|
std::cout << "Mult: " << operation << std::endl;
|
|
|
|
operation = with / without;
|
|
std::cout << "Div: " << operation << std::endl;
|
|
} |