CPN
Computational Process Networks
Classes | Functions
uint128_t.h File Reference

This is a very simple implementation of a 128 bit number. More...

#include <cpn/common.h>
+ Include dependency graph for uint128_t.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  uint128_t
 

Functions

bool operator< (const uint128_t &l, const uint128_t &r)
 
bool operator>= (const uint128_t &l, const uint128_t &r)
 
bool operator<= (const uint128_t &l, const uint128_t &r)
 
bool operator> (const uint128_t &l, const uint128_t &r)
 
bool operator== (const uint128_t &l, const uint128_t &r)
 
bool operator!= (const uint128_t &l, const uint128_t &r)
 

Detailed Description

This is a very simple implementation of a 128 bit number.

Author
John Bridgman No arithmatic operators are provided as they aren't currently needed. Maybe if they are needed add them.

Definition in file uint128_t.h.

Function Documentation

bool operator!= ( const uint128_t l,
const uint128_t r 
)
inline

Definition at line 48 of file uint128_t.h.

48 { return !(r == l); }
bool operator< ( const uint128_t l,
const uint128_t r 
)
inline

Definition at line 38 of file uint128_t.h.

References uint128_t::high, and uint128_t::low.

38  {
39  if (l.high == r.high) { return l.low < r.low; }
40  else { return l.high < r.high; }
41 }
uint64_t high
Definition: uint128_t.h:35
uint64_t low
Definition: uint128_t.h:35
bool operator<= ( const uint128_t l,
const uint128_t r 
)
inline

Definition at line 43 of file uint128_t.h.

43 { return !(r < l); }
bool operator== ( const uint128_t l,
const uint128_t r 
)
inline

Definition at line 45 of file uint128_t.h.

References uint128_t::high, and uint128_t::low.

45  {
46  return (l.high == r.high && l.low == r.low);
47 }
uint64_t high
Definition: uint128_t.h:35
uint64_t low
Definition: uint128_t.h:35
bool operator> ( const uint128_t l,
const uint128_t r 
)
inline

Definition at line 44 of file uint128_t.h.

44 { return (r < l); }
bool operator>= ( const uint128_t l,
const uint128_t r 
)
inline

Definition at line 42 of file uint128_t.h.

42 { return !(l < r); }