User RPL programming - Hewlett Packard

This is a discussion on User RPL programming - Hewlett Packard ; Hi all, I am a fairly new 50g user, studying Naval Architecture. I was reading Mr. Eduardo Kalinowski's Programming in user RPL and have a few questions. For the Question below: 2. Design a program that, when the radius of ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: User RPL programming

  1. User RPL programming

    Hi all,

    I am a fairly new 50g user, studying Naval Architecture.
    I was reading Mr. Eduardo Kalinowski's Programming in user RPL and
    have a few questions.

    For the Question below:
    2. Design a program that, when the radius of a sphere is in level one,
    calculates its
    volume. (V = 4/3 Pi r^3).

    The answer at the back of the book is given as:
    << 3 ^ Pi 4 3 * / ->NUM >>

    Shouldnt it be?
    << 3 ^ Pi * 4 * 3 / ->NUM >>

    Also the answer to 3 and 4 is swapped.
    Am I right about these i.e. they are errata?

    Would have loved to be at the HHC 2007. Hope to see the people from
    this group at some HHC someday.
    Thanks in advance for the answers.

    Gurpreet Singh Grewal.

  2. Re: User RPL programming

    Governing Dynamics wrote:
    >
    > The answer at the back of the book is given as:
    ><< 3 ^ Pi 4 3 * / ->NUM >>


    No, it doesn't make sense - the easy way to check is plugging it in and
    seeing that it doesn't work. I'm thinking the author was going for:

    << 3 ^ Pi 4 3 / * * ->NUM >>

    >
    > Shouldnt it be?
    ><< 3 ^ Pi * 4 * 3 / ->NUM >>
    >


    This is how I would write it - makes more sense to keep the numbers
    and operations together in my mind.

    - Kurt

  3. Re: User RPL programming

    > This is how I would write it - makes more sense to keep the numbers
    > and operations together in my mind.


    Or you could go with:

    << 673969 418097 / 3 ^ >>

    for obfuscation purposes. Generally I agree with you, as doing so
    helps avoid the type of error that was reportedly published.

    There is something gratifying, however, about triumphantly banging out
    * - + / to bring the parts of some calculation together in a final
    flourish of rpn virtuosity.

+ Reply to Thread