Author Topic: carot  (Read 2888 times)

shankle

  • Member
  • ****
  • Posts: 857
carot
« on: January 12, 2015, 02:14:53 AM »
Mistake - threw away my BASIC manuals.
I am trying to covert a Basic program from years ago to GoAsm.
I can't find out what the symbol (^) or Carot does.
I think it has to do with an exponential.

 a! = (i! * l!) / ((1 - (i! + 1) ^ -m%))
Thanks for any help...

jj2007

  • Member
  • *****
  • Posts: 10540
  • Assembler is fun ;-)
    • MasmBasic
Re: carot
« Reply #1 on: January 12, 2015, 02:47:28 AM »
2^3=2*2*2=8

shankle

  • Member
  • ****
  • Posts: 857
Re: carot
« Reply #2 on: January 12, 2015, 04:18:43 AM »
Thank you JJ.
It is definitely an exponent.

Now the problem is how to convert it to GoAsm.
I did look through the help files and didn't see anything about
carot usage. But it is possible I missed it or did not know where
to look.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: carot
« Reply #3 on: January 12, 2015, 04:34:26 AM »
hi Jack

here is a GWBASIC manual - pretty much the same thing

http://www.antonis.de/qbebooks/gwbasman/

top left - chapter 6 gives much of the syntax
besides carot.....

% integer
! single precision float
# double precision float
$ string

shankle

  • Member
  • ****
  • Posts: 857
Re: carot
« Reply #4 on: January 12, 2015, 05:30:04 AM »
Thanks Dave.

I have got to stop throwing things away.:(

anunitu

  • Member
  • *****
  • Posts: 1145
Re: carot
« Reply #5 on: January 12, 2015, 06:17:46 AM »
That is a nice reference site Dave...

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1209
Re: carot
« Reply #6 on: January 23, 2015, 03:27:15 PM »
The CRT pow function is easy to use, here in a MASM example:
Code: [Select]
;=====================================================================================
include \masm32\include\masm32rt.inc
;=====================================================================================
.data
    x REAL8 2.0   
    y REAL8 3.0
    z REAL8 ?
.code
;=====================================================================================
start:
;=====================================================================================
    invoke crt_pow, x, y
    fstp z
    printf("%f\n",z)
    inkey
    exit
end start
Code: [Select]
8.000000

For the MASM32 libraries the CRT functions have "crt_" in front of the function name to avoid name conflicts. For GoAsm I expect you would need to invoke the function as "pow".
Well Microsoft, here’s another nice mess you’ve gotten us into.