Loading ...
Sorry, an error occurred while loading the content.

use of libertybasic

Expand Messages
  • phil
    please - has anyone found a way to use complewx numbers in liberty basic ? thanks - phil geffe
    Message 1 of 5 , Mar 30, 2013
    • 0 Attachment
      please - has anyone found a way to use complewx numbers in liberty basic ?
      thanks - phil geffe
    • Fred Jensen
      ... I ve never see a BASIC that had complex arithmetic built in. Then of course, I have seen only a handful of BASIC s, Liberty being the last. In all the
      Message 2 of 5 , Mar 30, 2013
      • 0 Attachment
        On 3/30/2013 11:49 AM, phil wrote:
        > please - has anyone found a way to use complewx numbers in liberty basic ?
        > thanks - phil geffe

        I've never see a BASIC that had complex arithmetic built in. Then of
        course, I have seen only a handful of BASIC's, Liberty being the last.
        In all the other cases, I had to write functions and subroutines to do
        the arithmetic ...

        function mag(rx, ix)
        mag=sqr(rx^2+ix^2)
        end function

        where rx is the real part and ix is the imaginary part. mag is a real
        of course. In languages where you can pass vectors, the above would become

        function mag(v)
        mag=sqr(v[1]^2+v[2]^2)
        end function

        I have no idea if that will work in LB.

        Same with linear algebra ...

        Also true of FORTRAN, and many other ancient languages.

        Regards,

        Fred
        Auburn CA
      • David Speck
        Phil, It s been a LONG time since I thought about SQRT(-1), but IIRC, complex numbers worked the same as real numbers -- you just have to handle the real and
        Message 3 of 5 , Mar 30, 2013
        • 0 Attachment
          Phil,

          It's been a LONG time since I thought about SQRT(-1), but IIRC, complex
          numbers worked the same as real numbers -- you just have to handle the
          real and imaginary components separately.

          LB doesn't have built-in facilities to handle complex numbers -- that
          would be pretty far from its mission to be a relatively simple and
          uncluttered language.

          However, it shouldn't be too hard to set up some rudimentary routines
          that would take the real and imaginary parts as a two element array
          value, do the math, and return a two element array variable with a real
          and imaginary part.

          I'm not aware of anyone who's already done this, but if you can find
          corresponding algorithms on the 'net, you should be able to translate
          them to LB.

          Might search the LB conforums at:

          http://libertybasic.conforums.com/

          I came up with one promising post that sounds like what I proposed:

          http://libertybasic.conforums.com/index.cgi?board=open&action=display&num=1307908181

          HTH,

          Dave

          On 3/30/2013 2:49 PM, phil wrote:
          > please - has anyone found a way to use complex numbers in liberty basic ?
          > thanks - phil geffe
        • Stefan
          ... You may also check out http://justbasic.conforums.com/index.cgi?board=tips&action=display&num=1364468949 ... Stefan P.
          Message 4 of 5 , Mar 31, 2013
          • 0 Attachment
            --- In libertybasic@yahoogroups.com, Fred Jensen <k6dgw@...> wrote:
            >
            > On 3/30/2013 11:49 AM, phil wrote:
            > > please - has anyone found a way to use complewx numbers in liberty basic ?
            > > thanks - phil geffe
            >
            > I've never see a BASIC that had complex arithmetic built in. Then of
            > course, I have seen only a handful of BASIC's, Liberty being the last.
            > In all the other cases, I had to write functions and subroutines to do
            > the arithmetic ...
            >

            You may also check out http://justbasic.conforums.com/index.cgi?board=tips&action=display&num=1364468949

            ---
            Stefan P.
          • John Fisher
            You might like to look at http://diga.me.uk/index.html - scroll to the Complexity link. If you search the JB & LB boards there s quite a lot of stuff from
            Message 5 of 5 , Mar 31, 2013
            • 0 Attachment
              You might like to look at
              http://diga.me.uk/index.html - scroll to the 'Complexity' link.

              If you search the JB & LB boards there's quite a lot of stuff from me,
              tsh73, bluatigro et al on representing complex numbers in LB.

              'tenochtitlanuk' - JohnF
            Your message has been successfully submitted and would be delivered to recipients shortly.