Advertisement
Guest User

lab4

a guest
Oct 15th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <reg51.h>
  2.  
  3. float x;
  4. unsigned char xdata y[201], i;
  5.  
  6. float f(float x)
  7. {
  8. return (1 + (x / 2) - (x*x) / (2 * 4) + 3 * (x*x*x) / (2 * 4 * 6) - 3 * 5 * (x*x*x*x) / (2 * 4 * 6 * 9)) * 100;
  9. }
  10.  
  11. main()
  12. {
  13. i = 0;
  14. for (x=-1.0; x <= 1.0; x += 0.01)
  15. y[i++] = f(x);
  16. while(1)
  17. {
  18. i = 0;
  19. for (x=-1.0; x <= 1; x += 0.01)
  20. {
  21. f(x);
  22. P1 = y[i++];
  23. }
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement