www.delorie.com/gnu/docs/calc/calc_53.html   search  
 
Buy the book!


GNU Emacs Calc 2.02 Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.7.19 List Tutorial Exercise 1

We can use v x to build a vector of integers. This needs to be adjusted to get the range of integers we desire. Mapping `-' across the vector will accomplish this, although it turns out the plain `-' key will work just as well.

 
2:  2                              2:  2
1:  [1, 2, 3, 4, 5, 6, 7, 8, 9]    1:  [-4, -3, -2, -1, 0, 1, 2, 3, 4]
    .                                  .

    2  v x 9 RET                       5 V M -   or   5 -

Now we use V M ^ to map the exponentiation operator across the vector.

 
1:  [0.0625, 0.125, 0.25, 0.5, 1, 2, 4, 8, 16]
    .

    V M ^


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003