Back to index

php5  5.3.10
Classes | Defines | Typedefs | Enumerations | Functions
bcmath.h File Reference
#include "php.h"
#include "../../php_bcmath.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  bc_struct

Defines

#define BASE   10
#define CH_VAL(c)   (c - '0')
#define BCD_CHAR(d)   (d + '0')
#define MAX(a, b)   ((a)>(b)?(a):(b))
#define MIN(a, b)   ((a)>(b)?(b):(a))
#define ODD(a)   ((a)&1)
#define bc_new_num(length, scale)   _bc_new_num_ex((length), (scale), 0)
#define bc_free_num(num)   _bc_free_num_ex((num), 0)

Typedefs

typedef struct bc_structbc_num
typedef struct bc_struct bc_struct

Enumerations

enum  sign { PLUS, MINUS }

Functions

 _PROTOTYPE (void bc_init_numbers,(TSRMLS_D))
 _PROTOTYPE (bc_num _bc_new_num_ex,(int length, int scale, int persistent))
 _PROTOTYPE (void _bc_free_num_ex,(bc_num *num, int persistent))
 _PROTOTYPE (bc_num bc_copy_num,(bc_num num))
 _PROTOTYPE (void bc_init_num,(bc_num *num TSRMLS_DC))
 _PROTOTYPE (void bc_str2num,(bc_num *num, char *str, int scale TSRMLS_DC))
 _PROTOTYPE (char *bc_num2str,(bc_num num))
 _PROTOTYPE (void bc_int2num,(bc_num *num, int val))
 _PROTOTYPE (long bc_num2long,(bc_num num))
 _PROTOTYPE (int bc_compare,(bc_num n1, bc_num n2))
 _PROTOTYPE (char bc_is_zero,(bc_num num TSRMLS_DC))
 _PROTOTYPE (char bc_is_near_zero,(bc_num num, int scale))
 _PROTOTYPE (char bc_is_neg,(bc_num num))
 _PROTOTYPE (void bc_add,(bc_num n1, bc_num n2, bc_num *result, int scale_min))
 _PROTOTYPE (void bc_multiply,(bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC))
 _PROTOTYPE (int bc_divide,(bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC))
 _PROTOTYPE (int bc_modulo,(bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC))
 _PROTOTYPE (int bc_divmod,(bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale TSRMLS_DC))
 _PROTOTYPE (int bc_raisemod,(bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale TSRMLS_DC))
 _PROTOTYPE (void bc_raise,(bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC))
 _PROTOTYPE (int bc_sqrt,(bc_num *num, int scale TSRMLS_DC))
 _PROTOTYPE (void bc_out_num,(bc_num num, int o_base, void(*out_char)(int), int leading_zero TSRMLS_DC))
 _PROTOTYPE (void bc_rt_warn,(char *mesg,...))
 _PROTOTYPE (void bc_out_of_memory,(void))

Class Documentation

struct bc_struct

Definition at line 39 of file bcmath.h.

Collaboration diagram for bc_struct:
Class Members
int n_len
bc_num n_next
char * n_ptr
int n_refs
int n_scale
sign n_sign
char * n_value

Define Documentation

#define BASE   10

Definition at line 65 of file bcmath.h.

#define bc_free_num (   num)    _bc_free_num_ex((num), 0)

Definition at line 160 of file bcmath.h.

#define bc_new_num (   length,
  scale 
)    _bc_new_num_ex((length), (scale), 0)

Definition at line 159 of file bcmath.h.

#define BCD_CHAR (   d)    (d + '0')

Definition at line 70 of file bcmath.h.

#define CH_VAL (   c)    (c - '0')

Definition at line 69 of file bcmath.h.

#define MAX (   a,
 
)    ((a)>(b)?(a):(b))

Definition at line 76 of file bcmath.h.

#define MIN (   a,
 
)    ((a)>(b)?(b):(a))

Definition at line 77 of file bcmath.h.

#define ODD (   a)    ((a)&1)

Definition at line 78 of file bcmath.h.


Typedef Documentation

typedef struct bc_struct* bc_num

Definition at line 37 of file bcmath.h.

typedef struct bc_struct bc_struct

Enumeration Type Documentation

enum sign
Enumerator:
PLUS 
MINUS 

Definition at line 35 of file bcmath.h.


Function Documentation

_PROTOTYPE ( void  bc_init_numbers,
(TSRMLS_D  
)
_PROTOTYPE ( bc_num  _bc_new_num_ex,
(int length, int scale, int persistent)   
)
_PROTOTYPE ( void  _bc_free_num_ex,
(bc_num *num, int persistent)   
)
_PROTOTYPE ( bc_num  bc_copy_num,
(bc_num num)   
)
_PROTOTYPE ( void  bc_init_num,
(bc_num *num TSRMLS_DC  
)
_PROTOTYPE ( void  bc_str2num,
(bc_num *num, char *str, int scale TSRMLS_DC  
)
_PROTOTYPE ( char *  bc_num2str,
(bc_num num)   
)
_PROTOTYPE ( void  bc_int2num,
(bc_num *num, int val)   
)
_PROTOTYPE ( long  bc_num2long,
(bc_num num)   
)
_PROTOTYPE ( int  bc_compare,
(bc_num n1, bc_num n2)   
)
_PROTOTYPE ( char  bc_is_zero,
(bc_num num TSRMLS_DC  
)
_PROTOTYPE ( char  bc_is_near_zero,
(bc_num num, int scale  
)
_PROTOTYPE ( char  bc_is_neg,
(bc_num num)   
)
_PROTOTYPE ( void  bc_add,
(bc_num n1, bc_num n2, bc_num *result, int scale_min)   
)
_PROTOTYPE ( void  bc_multiply,
(bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC  
)
_PROTOTYPE ( int  bc_divide,
(bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC  
)
_PROTOTYPE ( int  bc_modulo,
(bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC  
)
_PROTOTYPE ( int  bc_divmod,
(bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale TSRMLS_DC  
)
_PROTOTYPE ( int  bc_raisemod,
(bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale TSRMLS_DC  
)
_PROTOTYPE ( void  bc_raise,
(bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC  
)
_PROTOTYPE ( int  bc_sqrt,
(bc_num *num, int scale TSRMLS_DC  
)
_PROTOTYPE ( void  bc_out_num,
(bc_num num, int o_base, void(*out_char)(int), int leading_zero TSRMLS_DC  
)
_PROTOTYPE ( void  bc_rt_warn,
(char *mesg,...)   
)
_PROTOTYPE ( void  bc_out_of_memory,
(void)   
)