p2  0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PNDouble Struct Reference

doubles are floating point numbers stored as binary data. More...

#include <potion.h>

Public Member Functions

static PN potion_dbl_add (Potion *P, PN cl, PN self, PN num)
 
static PN potion_dbl_sub (Potion *P, PN cl, PN self, PN num)
 
static PN potion_dbl_mult (Potion *P, PN cl, PN self, PN num)
 
static PN potion_dbl_div (Potion *P, PN cl, PN self, PN num)
 
PN potion_dbl_string (Potion *P, PN cl, PN self)
 
static PN potion_dbl_abs (Potion *P, PN cl, PN self)
 
static PN potion_dbl_cmp (Potion *P, PN cl, PN self, PN n)
 

Data Fields

 PN_OBJECT_HEADER
 PNType vt; PNUniq uniq. More...
 
double value
 

Detailed Description

doubles are floating point numbers stored as binary data.

immutable.

Definition at line 361 of file potion.h.

Member Function Documentation

static PN potion_dbl_add ( Potion P,
PN  cl,
PN  self,
PN  num 
)

"+" method

Parameters
numPNDouble
Returns
PNDouble

Definition at line 221 of file number.c.

static PN potion_dbl_sub ( Potion P,
PN  cl,
PN  self,
PN  num 
)

"-" method

Parameters
numPNDouble
Returns
PNDouble

Definition at line 226 of file number.c.

static PN potion_dbl_mult ( Potion P,
PN  cl,
PN  self,
PN  num 
)

"*" method

Parameters
numPNDouble
Returns
PNDouble

Definition at line 231 of file number.c.

static PN potion_dbl_div ( Potion P,
PN  cl,
PN  self,
PN  num 
)

"/" method

Parameters
numPNDouble
Returns
PNDouble

Definition at line 236 of file number.c.

PN potion_dbl_string ( Potion P,
PN  cl,
PN  self 
)

"string" method, stringify

Returns
PNString

Definition at line 241 of file number.c.

static PN potion_dbl_abs ( Potion P,
PN  cl,
PN  self 
)

"abs"

Returns
PNDouble

Definition at line 380 of file number.c.

static PN potion_dbl_cmp ( Potion P,
PN  cl,
PN  self,
PN  n 
)

"cmp" a double to a value. casts argument n to a number

1 cmp 2 #=> -1
1 cmp 1 #=> 0
1 cmp 0 #=> 1
Parameters
nPN number compared to
Returns
PNInteger -1, 0 or 1

Definition at line 415 of file number.c.

Field Documentation

PNDouble::PN_OBJECT_HEADER

PNType vt; PNUniq uniq.

Definition at line 362 of file potion.h.

double PNDouble::value

Definition at line 363 of file potion.h.


The documentation for this struct was generated from the following files: