~ubuntu-branches/ubuntu/precise/luajit/precise

« back to all changes in this revision

Viewing changes to src/lj_vmmath.c

  • Committer: Package Import Robot
  • Author(s): Enrico Tassi
  • Date: 2011-12-19 17:20:40 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20111219172040-erhq86w7woguajvb
Tags: 2.0.0~beta9+dfsg-1
* New upstream release with powerpc support
* Refreshed quilt patches
* Removed beta8_hotfix1 patch, no more needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#define lj_vmmath_c
7
7
#define LUA_CORE
8
8
 
 
9
#include <errno.h>
9
10
#include <math.h>
10
11
 
11
12
#include "lj_obj.h"
25
26
 
26
27
#if LJ_HASJIT
27
28
 
28
 
#if defined(__ANDROID__) || defined(__symbian__)
 
29
#ifdef LUAJIT_NO_LOG2
29
30
double lj_vm_log2(double a)
30
31
{
31
32
  return log(a) * 1.4426950408889634074;
32
33
}
33
34
#endif
34
35
 
35
 
#if defined(__symbian__)
 
36
#ifdef LUAJIT_NO_EXP2
36
37
double lj_vm_exp2(double a)
37
38
{
38
39
  return exp(a * 0.6931471805599453);
39
40
}
40
41
#endif
41
42
 
42
 
#if !LJ_TARGET_ARM
 
43
#if !(LJ_TARGET_ARM || LJ_TARGET_PPC)
43
44
int32_t LJ_FASTCALL lj_vm_modi(int32_t a, int32_t b)
44
45
{
45
46
  uint32_t y, ua, ub;
81
82
  else if (k == 1)
82
83
    return x;
83
84
  else if (k == 0)
84
 
    return 1;
 
85
    return 1.0;
85
86
  else
86
87
    return 1.0 / lj_vm_powui(x, (uint32_t)-k);
87
88
}
108
109
}
109
110
#endif
110
111
 
 
112
#if LJ_HASFFI
 
113
int lj_vm_errno(void)
 
114
{
 
115
  return errno;
 
116
}
 
117
#endif
 
118
 
111
119
#endif