CHDK_DE Vorschauversion  Trunk Rev. 6014
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
limathlib.c-Dateireferenz
#include "stdlib.h"
#include "math.h"
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#include "cordic_math.h"
+ Include-Abhängigkeitsdiagramm für limathlib.c:

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define limathlib_c
 
#define LUA_LIB
 

Funktionen

LUALIB_API double intToFloat (int val)
 
LUALIB_API int floatToInt (double val)
 
static int imath_muldiv (lua_State *L)
 
static int imath_mul (lua_State *L)
 
static int imath_div (lua_State *L)
 
static int imath_sinr (lua_State *L)
 
static int imath_cosr (lua_State *L)
 
static int imath_tanr (lua_State *L)
 
static int imath_recr (lua_State *L)
 
static int imath_asinr (lua_State *L)
 
static int imath_acosr (lua_State *L)
 
static int imath_atanr (lua_State *L)
 
static int imath_polr (lua_State *L)
 
static int imath_sind (lua_State *L)
 
static int imath_cosd (lua_State *L)
 
static int imath_tand (lua_State *L)
 
static int imath_recd (lua_State *L)
 
static int imath_asind (lua_State *L)
 
static int imath_acosd (lua_State *L)
 
static int imath_atand (lua_State *L)
 
static int imath_pold (lua_State *L)
 
static int imath_deg (lua_State *L)
 
static int imath_rad (lua_State *L)
 
static int imath_log (lua_State *L)
 
static int imath_log2 (lua_State *L)
 
static int imath_log10 (lua_State *L)
 
static int imath_pow (lua_State *L)
 
static int imath_sqrt (lua_State *L)
 
static int imath_int (lua_State *L)
 
static int imath_frac (lua_State *L)
 
static int imath_ceil (lua_State *L)
 
static int imath_floor (lua_State *L)
 
static int imath_round (lua_State *L)
 
LUALIB_API int luaopen_imath (lua_State *L)
 

Variablen

static const luaL_Reg imathlib []
 

Makro-Dokumentation

#define limathlib_c

Definiert in Zeile 13 der Datei limathlib.c.

#define LUA_LIB

Definiert in Zeile 14 der Datei limathlib.c.

Dokumentation der Funktionen

LUALIB_API int floatToInt ( double  val)

Definiert in Zeile 26 der Datei limathlib.c.

26  {
27  return FIXED2INTR(FIXED(val));
28 }
static int imath_acosd ( lua_State L)
static

Definiert in Zeile 130 der Datei limathlib.c.

130  {
132  return 1;
133 }
static int imath_acosr ( lua_State L)
static

Definiert in Zeile 81 der Datei limathlib.c.

81  {
83  return 1;
84 }
static int imath_asind ( lua_State L)
static

Definiert in Zeile 125 der Datei limathlib.c.

125  {
127  return 1;
128 }
static int imath_asinr ( lua_State L)
static

Definiert in Zeile 76 der Datei limathlib.c.

76  {
78  return 1;
79 }
static int imath_atand ( lua_State L)
static

Definiert in Zeile 135 der Datei limathlib.c.

135  {
137  return 1;
138 }
static int imath_atanr ( lua_State L)
static

Definiert in Zeile 86 der Datei limathlib.c.

86  {
88  return 1;
89 }
static int imath_ceil ( lua_State L)
static

Definiert in Zeile 196 der Datei limathlib.c.

196  {
198  return 1;
199 }
static int imath_cosd ( lua_State L)
static

Definiert in Zeile 106 der Datei limathlib.c.

106  {
108  return 1;
109 }
static int imath_cosr ( lua_State L)
static

Definiert in Zeile 57 der Datei limathlib.c.

57  {
59  return 1;
60 }
static int imath_deg ( lua_State L)
static

Definiert in Zeile 149 der Datei limathlib.c.

149  {
151  return 1;
152 }
static int imath_div ( lua_State L)
static

Definiert in Zeile 44 der Datei limathlib.c.

44  {
45  int c = luaL_checknumber(L, 2);
46  if (c == 0) luaL_error(L, "divide by 0");
48  return 1;
49 }
static int imath_floor ( lua_State L)
static

Definiert in Zeile 201 der Datei limathlib.c.

201  {
203  return 1;
204 }
static int imath_frac ( lua_State L)
static

Definiert in Zeile 191 der Datei limathlib.c.

191  {
193  return 1;
194 }
static int imath_int ( lua_State L)
static

Definiert in Zeile 186 der Datei limathlib.c.

186  {
188  return 1;
189 }
static int imath_log ( lua_State L)
static

Definiert in Zeile 159 der Datei limathlib.c.

159  {
161  return 1;
162 }
static int imath_log10 ( lua_State L)
static

Definiert in Zeile 169 der Datei limathlib.c.

169  {
171  return 1;
172 }
static int imath_log2 ( lua_State L)
static

Definiert in Zeile 164 der Datei limathlib.c.

164  {
166  return 1;
167 }
static int imath_mul ( lua_State L)
static

Definiert in Zeile 38 der Datei limathlib.c.

38  {
40  luaL_checknumber(L, 2), INT_SCALE));
41  return 1;
42 }
static int imath_muldiv ( lua_State L)
static

Definiert in Zeile 30 der Datei limathlib.c.

30  {
31  int c = luaL_checknumber(L, 3);
32  if (c == 0) luaL_error(L, "divide by 0");
34  luaL_checknumber(L, 2), c));
35  return 1;
36 }
static int imath_pold ( lua_State L)
static

Definiert in Zeile 140 der Datei limathlib.c.

140  {
141  fixed r, theta;
143  INT2FIXED(luaL_checknumber(L, 2)), &r, &theta);
144  lua_pushnumber(L, FIXED2INTR(r));
145  lua_pushnumber(L, FIXED2INTR(theta));
146  return 2;
147 }
static int imath_polr ( lua_State L)
static

Definiert in Zeile 91 der Datei limathlib.c.

91  {
92  fixed r, theta;
94  INT2FIXED(luaL_checknumber(L, 2)), &r, &theta);
96  lua_pushnumber(L, FIXED2INTR(theta));
97  return 2;
98 }
static int imath_pow ( lua_State L)
static

Definiert in Zeile 174 der Datei limathlib.c.

174  {
176  intToFloat(luaL_checknumber(L, 2)))));
177  return 1;
178 }
static int imath_rad ( lua_State L)
static

Definiert in Zeile 154 der Datei limathlib.c.

154  {
156  return 1;
157 }
static int imath_recd ( lua_State L)
static

Definiert in Zeile 116 der Datei limathlib.c.

116  {
117  fixed px, py;
119  INT2FIXED(luaL_checknumber(L, 2)), &px, &py);
120  lua_pushnumber(L, FIXED2INTR(px));
121  lua_pushnumber(L, FIXED2INTR(py));
122  return 2;
123 }
static int imath_recr ( lua_State L)
static

Definiert in Zeile 67 der Datei limathlib.c.

67  {
68  fixed px, py;
70  INT2FIXED(luaL_checknumber(L, 2)), &px, &py);
71  lua_pushnumber(L, FIXED2INTR(px));
72  lua_pushnumber(L, FIXED2INTR(py));
73  return 2;
74 }
static int imath_round ( lua_State L)
static

Definiert in Zeile 206 der Datei limathlib.c.

206  {
208  return 1;
209 }
static int imath_sind ( lua_State L)
static

Definiert in Zeile 101 der Datei limathlib.c.

101  {
103  return 1;
104 }
static int imath_sinr ( lua_State L)
static

Definiert in Zeile 52 der Datei limathlib.c.

52  {
54  return 1;
55 }
static int imath_sqrt ( lua_State L)
static

Definiert in Zeile 180 der Datei limathlib.c.

180  {
182  return 1;
183 }
static int imath_tand ( lua_State L)
static

Definiert in Zeile 111 der Datei limathlib.c.

111  {
113  return 1;
114 }
static int imath_tanr ( lua_State L)
static

Definiert in Zeile 62 der Datei limathlib.c.

62  {
64  return 1;
65 }
LUALIB_API double intToFloat ( int  val)

Definiert in Zeile 22 der Datei limathlib.c.

22  {
23  return FLOAT(INT2FIXED(val));
24 }
LUALIB_API int luaopen_imath ( lua_State L)

Definiert in Zeile 250 der Datei limathlib.c.

250  {
252 
254  lua_setfield(L, -2, "scale");
256  lua_setfield(L, -2, "pi2");
258  lua_setfield(L, -2, "pi");
260  lua_setfield(L, -2, "pi_2");
261 
262  return 1;
263 }

Variablen-Dokumentation

const luaL_Reg imathlib[]
static

Definiert in Zeile 211 der Datei limathlib.c.