Project 2 - Fixed-Point Number Class
Classes | Functions
fixed.hpp File Reference

Fixed-point numbers. More...

#include <istream>
#include <ostream>
#include <string>

Go to the source code of this file.

Classes

class  fixed
 Implement a fixed-point number class. Values have places places after the decimal point. All arithmetic follows the usual rules. More...
 

Functions

std::istream & operator>> (std::istream &strm, fixed &f)
 Read a fixed value.
 
std::ostream & operator<< (std::ostream &strm, fixed f)
 Write a fixed value.
 
fixed operator+ (fixed a, fixed b)
 Add fixed values.
 
fixed operator- (fixed a, fixed b)
 Subtract fixed values.
 
fixed operator* (fixed a, fixed b)
 Multiply fixed values.
 
fixed operator/ (fixed a, fixed b)
 Divide fixed values.
 
fixed operator- (fixed a)
 Negate a fixed value.
 
bool operator== (fixed a, fixed b)
 Compare fixed values for equality by comparing the underlying values.
 
bool operator!= (fixed a, fixed b)
 Compare fixed values for inequality by comparing the underlying values.
 
bool operator< (fixed a, fixed b)
 Compare fixed values for less-than by comparing the underlying values.
 
bool operator> (fixed a, fixed b)
 Compare fixed values for greater-than by comparing the underlying values.
 
bool operator<= (fixed a, fixed b)
 Compare fixed values for less-than-or-equal by comparing the underlying values.
 
bool operator>= (fixed a, fixed b)
 Compare fixed values for greater-than-or-equal by comparing the underlying values.
 

Detailed Description

Fixed-point numbers.

Definition in file fixed.hpp.