Rev 1764 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1005 | barsuk | 1 | #include |
2 | #include "kosSyst.h" |
||
3 | extern "C" int _fltused = 0; |
||
1764 | clevermous | 4 | double __cdecl acos(double x) |
1005 | barsuk | 5 | { |
6 | __asm { |
||
7 | fld qword ptr [esp+4] |
||
8 | fld1 |
||
9 | fadd st, st(1) |
||
10 | fld1 |
||
11 | fsub st, st(2) |
||
12 | fmulp st(1), st |
||
13 | fsqrt |
||
14 | fxch st(1) |
||
15 | fpatan |
||
16 | } |
||
17 | } |
||
1764 | clevermous | 18 | double __cdecl asin(double x) |
1005 | barsuk | 19 | { |
20 | __asm { |
||
21 | fld qword ptr [esp+4] |
||
22 | fld1 |
||
23 | fadd st, st(1) |
||
24 | fld1 |
||
25 | fsub st, st(2) |
||
26 | fmulp st(1), st |
||
27 | fsqrt |
||
28 | fpatan |
||
29 | ret |
||
30 | } |
||
31 | } |
||
32 | #if _MSC_VER <= 1200 |
||
33 | extern "C" double _ftol(double x) |
||
34 | { |
||
35 | __asm { |
||
36 | fld qword ptr [esp+4] |
||
37 | push 1F3Fh |
||
38 | fstcw word ptr [esp+2] |
||
39 | fldcw word ptr [esp] |
||
40 | frndint |
||
41 | fldcw word ptr [esp+2] |
||
42 | add esp, 4 |
||
43 | } |
||
44 | } |
||
45 | #endif |
||
5098 | clevermous | 46 | #pragma function(ceil) |
1764 | clevermous | 47 | double __cdecl ceil(double x) |
1005 | barsuk | 48 | { |
49 | __asm { |
||
50 | fld qword ptr [esp+4] |
||
51 | push 1B3Fh |
||
52 | fstcw word ptr [esp+2] |
||
53 | fldcw word ptr [esp] |
||
54 | frndint |
||
55 | fldcw word ptr [esp+2] |
||
56 | add esp, 4 |
||
57 | } |
||
58 | } |
||
59 | |||
1764 | clevermous | 60 | double __cdecl floor(double x) |
1005 | barsuk | 61 | { |
62 | __asm { |
||
63 | fld qword ptr [esp+4] |
||
64 | push 173Fh |
||
65 | fstcw word ptr [esp+2] |
||
66 | fldcw word ptr [esp] |
||
67 | frndint |
||
68 | fldcw word ptr [esp+2] |
||
69 | add esp, 4 |
||
70 | } |
||
71 | } |
||
72 | |||
1764 | clevermous | 73 | double __cdecl round(double x) |
1005 | barsuk | 74 | { |
75 | __asm { |
||
76 | fld qword ptr [esp+4] |
||
77 | push 133Fh |
||
78 | fstcw word ptr [esp+2] |
||
79 | fldcw word ptr [esp] |
||
80 | frndint |
||
81 | fldcw word ptr [esp+2] |
||
82 | add esp, 4 |
||
83 | } |
||
84 | }=> |