Defines | Functions | Variables

lua/lmathlib.c File Reference

#include <stdlib.h>
#include <math.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Include dependency graph for lmathlib.c:

Go to the source code of this file.

Defines

#define lmathlib_c
#define LUA_LIB
#define PI   (3.14159265358979323846)
#define RADIANS_PER_DEGREE   (PI/180.0)
#define l_tg(x)   (x)

Functions

static int math_abs (lua_State *L)
static int math_sin (lua_State *L)
static int math_sinh (lua_State *L)
static int math_cos (lua_State *L)
static int math_cosh (lua_State *L)
static int math_tan (lua_State *L)
static int math_tanh (lua_State *L)
static int math_asin (lua_State *L)
static int math_acos (lua_State *L)
static int math_atan (lua_State *L)
static int math_atan2 (lua_State *L)
static int math_ceil (lua_State *L)
static int math_floor (lua_State *L)
static int math_fmod (lua_State *L)
static int math_modf (lua_State *L)
static int math_sqrt (lua_State *L)
static int math_pow (lua_State *L)
static int math_log (lua_State *L)
static int math_log10 (lua_State *L)
static int math_exp (lua_State *L)
static int math_deg (lua_State *L)
static int math_rad (lua_State *L)
static int math_frexp (lua_State *L)
static int math_ldexp (lua_State *L)
static int math_min (lua_State *L)
static int math_max (lua_State *L)
static int math_random (lua_State *L)
static int math_randomseed (lua_State *L)
LUAMOD_API int luaopen_math (lua_State *L)

Variables

static const luaL_Reg mathlib []

Define Documentation

#define l_tg (   x  )     (x)
#define lmathlib_c

Definition at line 11 of file lmathlib.c.

#define LUA_LIB

Definition at line 12 of file lmathlib.c.

#define PI   (3.14159265358979323846)

Definition at line 21 of file lmathlib.c.

Referenced by luaopen_math().

#define RADIANS_PER_DEGREE   (PI/180.0)

Definition at line 22 of file lmathlib.c.

Referenced by math_deg(), and math_rad().


Function Documentation

LUAMOD_API int luaopen_math ( lua_State L  ) 

Definition at line 275 of file lmathlib.c.

References lua_pushnumber(), lua_setfield(), luaL_newlib, and PI.

Referenced by LuaKernel::LuaKernel().

Here is the call graph for this function:

Here is the caller graph for this function:

static int math_abs ( lua_State L  )  [static]

Definition at line 32 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_acos ( lua_State L  )  [static]

Definition at line 72 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_asin ( lua_State L  )  [static]

Definition at line 67 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_atan ( lua_State L  )  [static]

Definition at line 77 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_atan2 ( lua_State L  )  [static]

Definition at line 82 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_ceil ( lua_State L  )  [static]

Definition at line 88 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_cos ( lua_State L  )  [static]

Definition at line 47 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_cosh ( lua_State L  )  [static]

Definition at line 52 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_deg ( lua_State L  )  [static]

Definition at line 149 of file lmathlib.c.

References lua_pushnumber(), luaL_checknumber(), and RADIANS_PER_DEGREE.

Here is the call graph for this function:

static int math_exp ( lua_State L  )  [static]

Definition at line 144 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_floor ( lua_State L  )  [static]

Definition at line 93 of file lmathlib.c.

References floating_point_emulation::floor(), l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_fmod ( lua_State L  )  [static]

Definition at line 98 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_frexp ( lua_State L  )  [static]

Definition at line 159 of file lmathlib.c.

References l_tg, lua_pushinteger(), lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_ldexp ( lua_State L  )  [static]

Definition at line 166 of file lmathlib.c.

References l_tg, lua_pushnumber(), luaL_checkint, and luaL_checknumber().

Here is the call graph for this function:

static int math_log ( lua_State L  )  [static]

Definition at line 123 of file lmathlib.c.

References l_tg, lua_isnoneornil, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_log10 ( lua_State L  )  [static]

Definition at line 138 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_max ( lua_State L  )  [static]

Definition at line 188 of file lmathlib.c.

References lua_gettop(), lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_min ( lua_State L  )  [static]

Definition at line 174 of file lmathlib.c.

References lua_gettop(), lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_modf ( lua_State L  )  [static]

Definition at line 104 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_pow ( lua_State L  )  [static]

Definition at line 117 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_rad ( lua_State L  )  [static]

Definition at line 154 of file lmathlib.c.

References lua_pushnumber(), luaL_checknumber(), and RADIANS_PER_DEGREE.

Here is the call graph for this function:

static int math_random ( lua_State L  )  [static]

Definition at line 202 of file lmathlib.c.

References floating_point_emulation::floor(), l_tg, lua_gettop(), lua_pushnumber(), luaL_argcheck, luaL_checknumber(), and luaL_error().

Here is the call graph for this function:

static int math_randomseed ( lua_State L  )  [static]

Definition at line 230 of file lmathlib.c.

References luaL_checkunsigned().

Here is the call graph for this function:

static int math_sin ( lua_State L  )  [static]

Definition at line 37 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_sinh ( lua_State L  )  [static]

Definition at line 42 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_sqrt ( lua_State L  )  [static]

Definition at line 112 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_tan ( lua_State L  )  [static]

Definition at line 57 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:

static int math_tanh ( lua_State L  )  [static]

Definition at line 62 of file lmathlib.c.

References l_tg, lua_pushnumber(), and luaL_checknumber().

Here is the call graph for this function:


Variable Documentation

const luaL_Reg mathlib[] [static]

Definition at line 237 of file lmathlib.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:07:16 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs