FAUST compiler  0.9.9.6b8
Public Member Functions | Private Attributes
num Class Reference

#include <num.hh>

List of all members.

Public Member Functions

 num (int x=0)
 num (double x)
 num (const num &n)
numoperator= (int n)
numoperator= (double n)
bool operator== (const num &n) const
bool operator!= (const num &n) const
int type () const
 operator int () const
 operator double () const

Private Attributes

int fType
union {
   int   i
   double   f
fData

Detailed Description

Definition at line 58 of file num.hh.


Constructor & Destructor Documentation

num::num ( int  x = 0) [inline]

Definition at line 68 of file num.hh.

References fData.

: fType(0)          { fData.i = x; }
num::num ( double  x) [inline]

Definition at line 70 of file num.hh.

References fData.

: fType(1)          { fData.f = x; }
num::num ( const num n) [inline]

Definition at line 71 of file num.hh.

References fData, and i.

: fType(n.fType)    { fData.i = n.fData.i; }

Member Function Documentation

num::operator double ( ) const [inline]

Definition at line 83 of file num.hh.

References fData, and fType.

{ return (fType) ? fData.f : double(fData.i); }
num::operator int ( ) const [inline]

Definition at line 82 of file num.hh.

References fData, and fType.

{ return (fType) ? int(fData.f) : fData.i; }
bool num::operator!= ( const num n) const [inline]

Definition at line 78 of file num.hh.

References fData, fType, and i.

{ return fType != n.fType || fData.i != n.fData.i; }
num& num::operator= ( int  n) [inline]

Definition at line 73 of file num.hh.

References fData, and fType.

{ fType = 0; fData.i = n; return *this; }
num& num::operator= ( double  n) [inline]

Definition at line 74 of file num.hh.

References fData, and fType.

{ fType = 1; fData.f = n; return *this; }
bool num::operator== ( const num n) const [inline]

Definition at line 77 of file num.hh.

References fData, fType, and i.

{ return fType == n.fType && fData.i == n.fData.i; }
int num::type ( ) const [inline]

Definition at line 81 of file num.hh.

References fType.

Referenced by isfloat().

{ return fType; }

Here is the caller graph for this function:


Member Data Documentation

double num::f

Definition at line 63 of file num.hh.

union { ... } num::fData [private]
int num::fType [private]

Definition at line 60 of file num.hh.

Referenced by operator double(), operator int(), operator!=(), operator=(), operator==(), and type().

int num::i

Definition at line 62 of file num.hh.

Referenced by num(), operator!=(), and operator==().


The documentation for this class was generated from the following file: