lua5.4
| 宏定义 | 类型定义 | 函数 | 变量
lmathlib.c 文件参考
#include "lprefix.h"
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
lmathlib.c 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

struct  Rand64
 
struct  RanState
 

宏定义

#define lmathlib_c
 
#define LUA_LIB
 
#define PI   (l_mathop(3.141592653589793238462643383279502884))
 
#define FIGS   l_floatatt(MANT_DIG)
 
#define trim32(x)   ((x) & 0xffffffffu)
 
#define UONE   ((lu_int32)1)
 
#define scaleFIG   (l_mathop(0.5) / (UONE << (FIGS - 1)))
 

类型定义

typedef unsigned long lu_int32
 
typedef struct Rand64 Rand64
 

函数

static int math_abs (lua_State *L)
 
static int math_sin (lua_State *L)
 
static int math_cos (lua_State *L)
 
static int math_tan (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_toint (lua_State *L)
 
static void pushnumint (lua_State *L, lua_Number d)
 
static int math_floor (lua_State *L)
 
static int math_ceil (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_ult (lua_State *L)
 
static int math_log (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_min (lua_State *L)
 
static int math_max (lua_State *L)
 
static int math_type (lua_State *L)
 
static Rand64 packI (lu_int32 h, lu_int32 l)
 
static Rand64 Ishl (Rand64 i, int n)
 
static void Ixor (Rand64 *i1, Rand64 i2)
 
static Rand64 Iadd (Rand64 i1, Rand64 i2)
 
static Rand64 times5 (Rand64 i)
 
static Rand64 times9 (Rand64 i)
 
static Rand64 rotl (Rand64 i, int n)
 
static Rand64 rotl1 (Rand64 i, int n)
 
static Rand64 nextrand (Rand64 *state)
 
static lua_Number I2d (Rand64 x)
 
static lua_Unsigned I2UInt (Rand64 x)
 
static Rand64 Int2I (lua_Unsigned n)
 
static lua_Unsigned project (lua_Unsigned ran, lua_Unsigned n, RanState *state)
 
static int math_random (lua_State *L)
 
static void setseed (lua_State *L, Rand64 *state, lua_Unsigned n1, lua_Unsigned n2)
 
static void randseed (lua_State *L, RanState *state)
 
static int math_randomseed (lua_State *L)
 
static void setrandfunc (lua_State *L)
 
LUAMOD_API int luaopen_math (lua_State *L)
 

变量

static const luaL_Reg randfuncs []
 
static const luaL_Reg mathlib []
 

宏定义说明

◆ FIGS

#define FIGS   l_floatatt(MANT_DIG)

◆ lmathlib_c

#define lmathlib_c

◆ LUA_LIB

#define LUA_LIB

◆ PI

#define PI   (l_mathop(3.141592653589793238462643383279502884))

◆ scaleFIG

#define scaleFIG   (l_mathop(0.5) / (UONE << (FIGS - 1)))

◆ trim32

#define trim32 (   x)    ((x) & 0xffffffffu)

◆ UONE

#define UONE   ((lu_int32)1)

类型定义说明

◆ lu_int32

typedef unsigned long lu_int32

◆ Rand64

typedef struct Rand64 Rand64

函数说明

◆ I2d()

static lua_Number I2d ( Rand64  x)
static
这是这个函数的调用关系图:

◆ I2UInt()

static lua_Unsigned I2UInt ( Rand64  x)
static
这是这个函数的调用关系图:

◆ Iadd()

static Rand64 Iadd ( Rand64  i1,
Rand64  i2 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ Int2I()

static Rand64 Int2I ( lua_Unsigned  n)
static
函数调用图:
这是这个函数的调用关系图:

◆ Ishl()

static Rand64 Ishl ( Rand64  i,
int  n 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ Ixor()

static void Ixor ( Rand64 i1,
Rand64  i2 
)
static
这是这个函数的调用关系图:

◆ luaopen_math()

LUAMOD_API int luaopen_math ( lua_State L)
函数调用图:

◆ math_abs()

static int math_abs ( lua_State L)
static
函数调用图:

◆ math_acos()

static int math_acos ( lua_State L)
static
函数调用图:

◆ math_asin()

static int math_asin ( lua_State L)
static
函数调用图:

◆ math_atan()

static int math_atan ( lua_State L)
static
函数调用图:

◆ math_ceil()

static int math_ceil ( lua_State L)
static
函数调用图:

◆ math_cos()

static int math_cos ( lua_State L)
static
函数调用图:

◆ math_deg()

static int math_deg ( lua_State L)
static
函数调用图:

◆ math_exp()

static int math_exp ( lua_State L)
static
函数调用图:

◆ math_floor()

static int math_floor ( lua_State L)
static
函数调用图:

◆ math_fmod()

static int math_fmod ( lua_State L)
static
函数调用图:

◆ math_log()

static int math_log ( lua_State L)
static
函数调用图:

◆ math_max()

static int math_max ( lua_State L)
static
函数调用图:

◆ math_min()

static int math_min ( lua_State L)
static
函数调用图:

◆ math_modf()

static int math_modf ( lua_State L)
static
函数调用图:

◆ math_rad()

static int math_rad ( lua_State L)
static
函数调用图:

◆ math_random()

static int math_random ( lua_State L)
static
函数调用图:

◆ math_randomseed()

static int math_randomseed ( lua_State L)
static
函数调用图:

◆ math_sin()

static int math_sin ( lua_State L)
static
函数调用图:

◆ math_sqrt()

static int math_sqrt ( lua_State L)
static
函数调用图:

◆ math_tan()

static int math_tan ( lua_State L)
static
函数调用图:

◆ math_toint()

static int math_toint ( lua_State L)
static
函数调用图:

◆ math_type()

static int math_type ( lua_State L)
static
函数调用图:

◆ math_ult()

static int math_ult ( lua_State L)
static
函数调用图:

◆ nextrand()

static Rand64 nextrand ( Rand64 state)
static
函数调用图:
这是这个函数的调用关系图:

◆ packI()

static Rand64 packI ( lu_int32  h,
lu_int32  l 
)
static
这是这个函数的调用关系图:

◆ project()

static lua_Unsigned project ( lua_Unsigned  ran,
lua_Unsigned  n,
RanState state 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ pushnumint()

static void pushnumint ( lua_State L,
lua_Number  d 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ randseed()

static void randseed ( lua_State L,
RanState state 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ rotl()

static Rand64 rotl ( Rand64  i,
int  n 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ rotl1()

static Rand64 rotl1 ( Rand64  i,
int  n 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ setrandfunc()

static void setrandfunc ( lua_State L)
static
函数调用图:
这是这个函数的调用关系图:

◆ setseed()

static void setseed ( lua_State L,
Rand64 state,
lua_Unsigned  n1,
lua_Unsigned  n2 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ times5()

static Rand64 times5 ( Rand64  i)
static
函数调用图:
这是这个函数的调用关系图:

◆ times9()

static Rand64 times9 ( Rand64  i)
static
函数调用图:
这是这个函数的调用关系图:

变量说明

◆ mathlib

const luaL_Reg mathlib[]
static

◆ randfuncs

const luaL_Reg randfuncs[]
static
初始值:
= {
{"random", math_random},
{"randomseed", math_randomseed},
{NULL, NULL}
}
math_randomseed
static int math_randomseed(lua_State *L)
Definition: lmathlib.c:617
math_random
static int math_random(lua_State *L)
Definition: lmathlib.c:556