How to store values in an array?How to pass a macro output to FPeval?How to create a “delay expansion”...

Pre-mixing cryogenic fuels and using only one fuel tank

What (the heck) is a Super Worm Equinox Moon?

Why do ¬, ∀ and ∃ have the same precedence?

What is the highest possible scrabble score for placing a single tile

Which Article Helped Get Rid of Technobabble in RPGs?

Do we have to expect a queue for the shuttle from Watford Junction to Harry Potter Studio?

awk assign to multiple variables at once

I found an audio circuit and I built it just fine, but I find it a bit too quiet. How do I amplify the output so that it is a bit louder?

Is there a RAID 0 Equivalent for RAM?

Quoting Keynes in a lecture

How can I write humor as character trait?

What to do when eye contact makes your coworker uncomfortable?

Has any country ever had 2 former presidents in jail simultaneously?

Why do Radio Buttons not fill the entire outer circle?

How to preserve electronics (computers, iPads and phones) for hundreds of years

Are Captain Marvel's powers affected by Thanos breaking the Tesseract and claiming the stone?

How can ping know if my host is down

Is it necessary to use pronouns with the verb "essere"?

How many arrows is an archer expected to fire by the end of the Tyranny of Dragons pair of adventures?

C++ copy constructor called at return

Strong empirical falsification of quantum mechanics based on vacuum energy density?

Is there any evidence that Cleopatra and Caesarion considered fleeing to India to escape the Romans?

How could a planet have erratic days?

Did the UK lift the requirement for registering SIM cards?



How to store values in an array?


How to pass a macro output to FPeval?How to create a “delay expansion” environment?How to parse optional arguments without keyval?How to seed FPseed with a value that is unique for every compilation?global variables and/or array of variablesHow to pass a command as uncover argumentfp - How to keep running sum in variable?How to extract integer part and fractional part of a decimal number?How to write Quadratic equation with negative coefficientArray variable with fp package: How to use FPeval in array?













0
















How to store a calculated value in array?




zz(1) = ( xx(1) + yy(1) )/2




fpevalzz(counter){(xx(counter)+yy(counter))/2} NOT working




documentclass{beamer}
usepackage{siunitx,amsmath}
usepackage{xparse,xfp}

ExplSyntaxOn
NewDocumentCommand{newarray}{m}
{
seq_new:c { l_hafid_array_#1_seq }
cs_new:cpn { #1 } ##1
{
seq_item:cn { l_hafid_array_#1_seq } { ##1 }
}
}
NewDocumentCommand{readarray}{mm}
{
seq_set_split:cnn { l_hafid_array_#1_seq } { & } { #2 }
}
cs_generate_variant:Nn seq_set_split:Nnn { c }

NewExpandableDocumentCommand{sumarray}{O{15}m}
{
fp_eval:n { round( seq_use:cn { l_hafid_array_#2_seq } { + }, #1 ) }
}

ExplSyntaxOff

begin{document}

newarray{xx}
readarray{xx}{1&2&3&4&5}

newarray{yy}
readarray{yy}{6&7&8&9&10}

begin{frame}
begin{table}[]
begin{tabular}{cccc}
No & xx & yy & zz \ hline
1 & xx{1} & yy{1} & fpeval{(xx{1}+yy{1})/2} \
2 & xx{2} & yy{2} & fpeval{(xx{2}+yy{2})/2} \
3 & xx{3} & yy{3} & \
4 & xx{4} & yy{4} & \
5 & xx{5} & yy{5} & \ hline
end{tabular}
end{table}
end{frame}

%newarray{zz}
%readarray{xx}{0&0&0&0&0}
newcountcounter
counter=5
loop
fpevalzz(counter){(xx(counter)+yy(counter))/2}
advance counter by -1
unlessifnum counter<1
repeat

end{document}








share



























    0
















    How to store a calculated value in array?




    zz(1) = ( xx(1) + yy(1) )/2




    fpevalzz(counter){(xx(counter)+yy(counter))/2} NOT working




    documentclass{beamer}
    usepackage{siunitx,amsmath}
    usepackage{xparse,xfp}

    ExplSyntaxOn
    NewDocumentCommand{newarray}{m}
    {
    seq_new:c { l_hafid_array_#1_seq }
    cs_new:cpn { #1 } ##1
    {
    seq_item:cn { l_hafid_array_#1_seq } { ##1 }
    }
    }
    NewDocumentCommand{readarray}{mm}
    {
    seq_set_split:cnn { l_hafid_array_#1_seq } { & } { #2 }
    }
    cs_generate_variant:Nn seq_set_split:Nnn { c }

    NewExpandableDocumentCommand{sumarray}{O{15}m}
    {
    fp_eval:n { round( seq_use:cn { l_hafid_array_#2_seq } { + }, #1 ) }
    }

    ExplSyntaxOff

    begin{document}

    newarray{xx}
    readarray{xx}{1&2&3&4&5}

    newarray{yy}
    readarray{yy}{6&7&8&9&10}

    begin{frame}
    begin{table}[]
    begin{tabular}{cccc}
    No & xx & yy & zz \ hline
    1 & xx{1} & yy{1} & fpeval{(xx{1}+yy{1})/2} \
    2 & xx{2} & yy{2} & fpeval{(xx{2}+yy{2})/2} \
    3 & xx{3} & yy{3} & \
    4 & xx{4} & yy{4} & \
    5 & xx{5} & yy{5} & \ hline
    end{tabular}
    end{table}
    end{frame}

    %newarray{zz}
    %readarray{xx}{0&0&0&0&0}
    newcountcounter
    counter=5
    loop
    fpevalzz(counter){(xx(counter)+yy(counter))/2}
    advance counter by -1
    unlessifnum counter<1
    repeat

    end{document}








    share

























      0












      0








      0









      How to store a calculated value in array?




      zz(1) = ( xx(1) + yy(1) )/2




      fpevalzz(counter){(xx(counter)+yy(counter))/2} NOT working




      documentclass{beamer}
      usepackage{siunitx,amsmath}
      usepackage{xparse,xfp}

      ExplSyntaxOn
      NewDocumentCommand{newarray}{m}
      {
      seq_new:c { l_hafid_array_#1_seq }
      cs_new:cpn { #1 } ##1
      {
      seq_item:cn { l_hafid_array_#1_seq } { ##1 }
      }
      }
      NewDocumentCommand{readarray}{mm}
      {
      seq_set_split:cnn { l_hafid_array_#1_seq } { & } { #2 }
      }
      cs_generate_variant:Nn seq_set_split:Nnn { c }

      NewExpandableDocumentCommand{sumarray}{O{15}m}
      {
      fp_eval:n { round( seq_use:cn { l_hafid_array_#2_seq } { + }, #1 ) }
      }

      ExplSyntaxOff

      begin{document}

      newarray{xx}
      readarray{xx}{1&2&3&4&5}

      newarray{yy}
      readarray{yy}{6&7&8&9&10}

      begin{frame}
      begin{table}[]
      begin{tabular}{cccc}
      No & xx & yy & zz \ hline
      1 & xx{1} & yy{1} & fpeval{(xx{1}+yy{1})/2} \
      2 & xx{2} & yy{2} & fpeval{(xx{2}+yy{2})/2} \
      3 & xx{3} & yy{3} & \
      4 & xx{4} & yy{4} & \
      5 & xx{5} & yy{5} & \ hline
      end{tabular}
      end{table}
      end{frame}

      %newarray{zz}
      %readarray{xx}{0&0&0&0&0}
      newcountcounter
      counter=5
      loop
      fpevalzz(counter){(xx(counter)+yy(counter))/2}
      advance counter by -1
      unlessifnum counter<1
      repeat

      end{document}








      share















      How to store a calculated value in array?




      zz(1) = ( xx(1) + yy(1) )/2




      fpevalzz(counter){(xx(counter)+yy(counter))/2} NOT working




      documentclass{beamer}
      usepackage{siunitx,amsmath}
      usepackage{xparse,xfp}

      ExplSyntaxOn
      NewDocumentCommand{newarray}{m}
      {
      seq_new:c { l_hafid_array_#1_seq }
      cs_new:cpn { #1 } ##1
      {
      seq_item:cn { l_hafid_array_#1_seq } { ##1 }
      }
      }
      NewDocumentCommand{readarray}{mm}
      {
      seq_set_split:cnn { l_hafid_array_#1_seq } { & } { #2 }
      }
      cs_generate_variant:Nn seq_set_split:Nnn { c }

      NewExpandableDocumentCommand{sumarray}{O{15}m}
      {
      fp_eval:n { round( seq_use:cn { l_hafid_array_#2_seq } { + }, #1 ) }
      }

      ExplSyntaxOff

      begin{document}

      newarray{xx}
      readarray{xx}{1&2&3&4&5}

      newarray{yy}
      readarray{yy}{6&7&8&9&10}

      begin{frame}
      begin{table}[]
      begin{tabular}{cccc}
      No & xx & yy & zz \ hline
      1 & xx{1} & yy{1} & fpeval{(xx{1}+yy{1})/2} \
      2 & xx{2} & yy{2} & fpeval{(xx{2}+yy{2})/2} \
      3 & xx{3} & yy{3} & \
      4 & xx{4} & yy{4} & \
      5 & xx{5} & yy{5} & \ hline
      end{tabular}
      end{table}
      end{frame}

      %newarray{zz}
      %readarray{xx}{0&0&0&0&0}
      newcountcounter
      counter=5
      loop
      fpevalzz(counter){(xx(counter)+yy(counter))/2}
      advance counter by -1
      unlessifnum counter<1
      repeat

      end{document}






      fp





      share












      share










      share



      share










      asked 5 mins ago









      sandusandu

      3,67942856




      3,67942856






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480828%2fhow-to-store-values-in-an-array%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480828%2fhow-to-store-values-in-an-array%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Can't compile dgruyter and caption packagesLaTeX templates/packages for writing a patent specificationLatex...

          Schneeberg (Smreczany) Bibliografia | Menu...

          Hans Bellmer Spis treści Życiorys | Upamiętnienie | Przypisy | Bibliografia | Linki zewnętrzne |...