SHARE
TWEET

Untitled

a guest Mar 21st, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. documentclass{article}
  2. usepackage{fp}
  3. usepackage{siunitx,amsmath}
  4. %usepackage{xparse}
  5. ExplSyntaxOn
  6. NewDocumentCommand{newarray}{m}
  7.  {
  8.   seq_new:c { l_hafid_array_ cs_to_str:N #1 _seq }
  9.   cs_new:Npn #1 (##1)
  10.    {
  11.     seq_item:cn { l_hafid_array_ cs_to_str:N #1 _seq } { ##1 }
  12.    }
  13.  }
  14. NewDocumentCommand{readarray}{mm}
  15.  {
  16.   seq_set_split:cnn { l_hafid_array_#1_seq } { & } { #2 }
  17.  }
  18. cs_generate_variant:Nn seq_set_split:Nnn { c }
  19. ExplSyntaxOff
  20.  
  21. begin{document}
  22.  
  23. newarraysomevalues
  24. readarray{somevalues}{1&2&3.5&4&5}
  25.  
  26. begin{align*}
  27. v_1 &= somevalues(1)\
  28. v_2 &= somevalues(2)\
  29. v_3 &= somevalues(3)\
  30. v_4 &= somevalues(4)\
  31. v_5 &= somevalues(5)
  32. end{align*}
  33.  
  34. First number = somevalues(1)\
  35. Second number = somevalues(2)
  36.  
  37. FPaddxx{somevalues(1)}{somevalues(2)}
  38. FPeval{xx}{round(xx,4)}%
  39. sum of first two numbers = xx
  40.  
  41. FPevalxx{somevalues(1)+somevalues(2)}
  42. FPeval{xx}{round(xx,4)}%
  43. sum of first two numbers = xx
  44.  
  45.  
  46. %
  47. newcountcount
  48. count=5
  49. FPsetans{0}
  50. loop
  51. %somevalues(count)\
  52. FPaddans{ans}{somevalues(count)}
  53. advance count by -1
  54. unlessifnum count<1
  55. repeat
  56. %
  57. FPeval{ans}{round(ans,4)}%
  58. sum of all numbers = ans
  59.  
  60. end{document}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top