python-on-a-chip online compiler

Dependencies:   mbed TSI

Embed: (wiki syntax)

« Back to documentation index

float.h File Reference

float.h File Reference

Float Object Type. More...

Go to the source code of this file.

Data Structures

struct  PmFloat_s
 Float obj. More...

Typedefs

typedef struct PmFloat_s PmFloat_t
 Float obj.

Functions

PmReturn_t float_new (float f, pPmObj_t *r_pf)
 Creates a new Float object.
PmReturn_t float_negative (pPmObj_t pf, pPmObj_t *r_pf)
 Implements the UNARY_NEGATIVE bcode.
PmReturn_t float_op (pPmObj_t px, pPmObj_t py, pPmObj_t *r_pn, int8_t op)
 Returns by reference a float that is x op y.
PmReturn_t float_compare (pPmObj_t px, pPmObj_t py, pPmObj_t *r_pobj, PmCompare_t cmp)
 Returns by reference a boolean that is x op y.
PmReturn_t float_print (pPmObj_t pf)
 Sends out a float object.

Detailed Description

Float Object Type.

Float object type header.

Definition in file float.h.


Typedef Documentation

typedef struct PmFloat_s PmFloat_t

Float obj.

32b floating point number


Function Documentation

PmReturn_t float_compare ( pPmObj_t  px,
pPmObj_t  py,
pPmObj_t r_pobj,
PmCompare_t  cmp 
)

Returns by reference a boolean that is x op y.

Parameters:
pxThe float left-hand argument
pyThe float right-hand argument
r_pnThe return value of x cmp y
cmpThe comparison operator
Returns:
Return status

Definition at line 154 of file float.c.

PmReturn_t float_negative ( pPmObj_t  pf,
pPmObj_t r_pf 
)

Implements the UNARY_NEGATIVE bcode.

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

Parameters:
pobjPointer to target object
r_pintReturn by ref, ptr to float
Returns:
Return status

Definition at line 81 of file float.c.

PmReturn_t float_new ( float  f,
pPmObj_t r_pf 
)

Creates a new Float object.

Parameters:
fValue to assign float (signed 32-bit).
r_pintReturn by ref, ptr to new float
Returns:
Return status

Definition at line 29 of file float.c.

PmReturn_t float_op ( pPmObj_t  px,
pPmObj_t  py,
pPmObj_t r_pn,
int8_t  op 
)

Returns by reference a float that is x op y.

Parameters:
pxThe float left-hand argument
pyThe float right-hand argument
r_pnThe return value of x op y
opThe operator (+,-,*,/ and power)
Returns:
Return status

Definition at line 91 of file float.c.

PmReturn_t float_print ( pPmObj_t  pf )

Sends out a float object.

The number is preceded with a "-" when necessary.

Parameters:
pObjPtr to float object
Returns:
Return status

Definition at line 44 of file float.c.