int.c File Reference

Integer Object Type. More...

#include <stdint.h>
#include <limits.h>
#include "pm.h"

Defines

#define __FILE_ID__   0x08

Functions

PmReturn_t int_dup (pPmObj_t pint, pPmObj_t *r_pint)
PmReturn_t int_new (int32_t n, pPmObj_t *r_pint)
PmReturn_t int_positive (pPmObj_t pobj, pPmObj_t *r_pint)
PmReturn_t int_negative (pPmObj_t pobj, pPmObj_t *r_pint)
PmReturn_t int_bitInvert (pPmObj_t pobj, pPmObj_t *r_pint)
PmReturn_t int_pow (pPmObj_t px, pPmObj_t py, pPmObj_t *r_pn)


Detailed Description

Integer Object Type.

Integer object type operations.


Function Documentation

PmReturn_t int_bitInvert ( pPmObj_t  pobj,
pPmObj_t r_pint 
)

Implements the UNARY_INVERT bcode.

Creates a new int with a value that is the bitwise inversion of the given int.

Parameters:
pobj Pointer to target object

PmReturn_t int_dup ( pPmObj_t  pint,
pPmObj_t r_pint 
)

Creates a duplicate Integer object

Created specifically for the index value in FOR_LOOP.

Parameters:
pint Pointer to int obj to duplicate.
r_pint Return by ref, ptr to new int
Returns:
Return status

PmReturn_t int_negative ( pPmObj_t  pobj,
pPmObj_t r_pint 
)

Implements the UNARY_NEGATIVE bcode.

Creates a new int with a value that is the negative of the given int.

Parameters:
pobj Pointer to target object
r_pint Return by ref, ptr to int
Returns:
Return status

PmReturn_t int_new ( int32_t  val,
pPmObj_t r_pint 
)

Creates a new Integer object

Parameters:
n Value to assign int (signed 32-bit).
r_pint Return by ref, ptr to new int
Returns:
Return status

PmReturn_t int_positive ( pPmObj_t  ,
pPmObj_t r_pint 
)

Implements the UNARY_POSITIVE bcode.

Creates a new int with the same value as the given int.

Parameters:
pobj Pointer to target object
r_pint Return by ref, ptr to int

PmReturn_t int_pow ( pPmObj_t  px,
pPmObj_t  py,
pPmObj_t r_pn 
)

Returns by reference an integer that is x raised to the power of y.

Parameters:
x The integer base
y The integer exponent
r_pn The return value of x ** y
Returns:
Return status


Generated on Wed Feb 24 13:37:02 2010 for Python-on-a-chip by  doxygen 1.5.9