Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <iomanip>
- using namespace std;
- int main() {
- double x = 1.0, ed = 1.0, res = 0.0, n = 1.0, eps = 1e-5, lres, sto = 100.0;
- int a[3];
- _asm {
- lea esi, a
- xor edx, edx
- mov ecx, 3
- _lb1:
- inc edx
- fld res
- fstp lres
- fld x
- fdiv n
- fadd res
- fstp res
- fld x
- fchs
- fstp x
- fld n
- fadd ed
- fstp n
- fld res
- fsub lres
- fabs
- fsub eps
- ftst
- fwait
- fstsw ax
- fstp lres
- test ax, 04500h
- jz _lb1
- mov [esi], edx
- add esi, 4
- fld eps
- fdiv sto
- fstp eps
- loop _lb1
- }
- cout << setprecision(15) << fixed << res << endl;
- setlocale(LC_ALL, ".1251");
- for (int i = 0; i < 3; ++i)
- cout << 5 + 2 * i << " знаков после запятой - " << a[i] << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment