-
Notifications
You must be signed in to change notification settings - Fork 24
B: Real
Havik2 edited this page Feb 24, 2018
·
3 revisions
The Real class identifies values as real, which encompasses the Rational and Integer classes. Includes comparison operators and arithmetic operations for the real numbers.
Holds a single double
with the name value
.
Has the arithmetic operations used for real numbers +, -, *, /, %
. Also has the comparison operations ==, >, <, >=, <=, !=
. The code also does not allow the user to set the value of value
.
#include <iostream>
#include "shaka_scheme/system/base/Real.hpp"
#include "shaka_scheme/system/base/Rational.hpp"
#include "shaka_scheme/system/base/Integer.hpp"
int main() {
std::cout<<"Real Number"<<std::endl;
shaka::Real r(24.5678);
std::cout<<r.get_value()<<std::endl;
}