Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

bigfix.cpp File Reference

#include <math.h>
#include <stdio.h>
#include "bigfix.h"

Include dependency graph for bigfix.cpp:

Go to the source code of this file.

Functions

BigFix operator * (BigFix a, BigFix b)
bool operator!= (BigFix a, BigFix b)
BigFix operator+ (BigFix a, BigFix b)
BigFix operator- (BigFix a, BigFix b)
bool operator== (BigFix a, BigFix b)

Variables

static unsigned char alphabet [65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"


Function Documentation

BigFix operator * BigFix  a,
BigFix  b
 

Definition at line 147 of file bigfix.cpp.

00148 {
00149     return BigFix();
00150 }

bool operator!= BigFix  a,
BigFix  b
 

Definition at line 162 of file bigfix.cpp.

00163 {
00164     return !(a == b);
00165 }

BigFix operator+ BigFix  a,
BigFix  b
 

Definition at line 125 of file bigfix.cpp.

References BigFix::n, and N_WORDS.

00126 {
00127     unsigned int carry = 0;
00128     BigFix c;
00129 
00130     for (int i = 0; i < N_WORDS; i++)
00131     {
00132         unsigned int m = a.n[i] + b.n[i] + carry;
00133         c.n[i] = (unsigned short) (m & 0xffff);
00134         carry = m >> 16;
00135     }
00136 
00137     return c;
00138 }

BigFix operator- BigFix  a,
BigFix  b
 

Definition at line 141 of file bigfix.cpp.

00142 {
00143     return a + -b;
00144 }

bool operator== BigFix  a,
BigFix  b
 

Definition at line 153 of file bigfix.cpp.

References BigFix::n, and N_WORDS.

00154 {
00155     for (int i = 0; i < N_WORDS; i++)
00156         if (a.n[i] != b.n[i])
00157             return false;
00158     return true;
00159 }


Variable Documentation

unsigned char alphabet[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" [static]
 

Definition at line 191 of file bigfix.cpp.

Referenced by BigFix::BigFix(), and BigFix::toString().


Generated on Sat Jan 14 22:32:56 2006 for Celestia by  doxygen 1.4.1