Author Topic: Function  (Read 7711 times)

0 Members and 1 Guest are viewing this topic.

Offline danny90444

  • LV3 Member (Next: 100)
  • ***
  • Posts: 41
  • Rating: +0/-0
  • Physics :)
    • View Profile
    • facebook
Re: Function
« Reply #15 on: July 06, 2012, 10:47:05 am »
The OP "registers" are a set of memory areas that are used as operands by the OS's floating point routines. Unless you need floating point, there shouldn't be a need to explicitly deal with them.
If you want to do math with larger integers, you basically need to write the routines yourself (precluding a library/axiom already having been written. I don't follow Axe too much.).
For example, to add the number BA (formed from variables A and B) to DC, and store the result back to BA, you could do something like A+C->A<C+B+D->B, where -> is the STO> symbol.
An easier-to-follow variation goes like this:
Code: [Select]
A+C->A
If A<C
B+D->B
Else
B+D+1->B
End


I don't understand the BA part. Is that one number split between two variables? And I don't know what floating point is exactly.
Schrodinger's cat walks into a bar... and doesn't.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Function
« Reply #16 on: July 06, 2012, 10:54:12 am »
I don't understand the BA part. Is that one number split between two variables? And I don't know what floating point is exactly.
Your number A is 16 bits (2 bytes). Let's represent a bit by X. So A looks like this
XXXXXXXXXXXXXXXX.
Same for B, B looks like this
XXXXXXXXXXXXXXXX.
Now, what would be BA ? It is B followed by A so BA looks like this
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
And you just created a 32 bits number ;)

Floating point is basically numbers with a decimal where the period is not at the same place for each number. So you could work with 53.21 and 589.4 as opposed to fixed point where the period is always at the same place for everyone :)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline danny90444

  • LV3 Member (Next: 100)
  • ***
  • Posts: 41
  • Rating: +0/-0
  • Physics :)
    • View Profile
    • facebook
Re: Function
« Reply #17 on: July 06, 2012, 01:19:17 pm »
I don't understand the BA part. Is that one number split between two variables? And I don't know what floating point is exactly.
Your number A is 16 bits (2 bytes). Let's represent a bit by X. So A looks like this
XXXXXXXXXXXXXXXX.
Same for B, B looks like this
XXXXXXXXXXXXXXXX.
Now, what would be BA ? It is B followed by A so BA looks like this
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
And you just created a 32 bits number ;)

Floating point is basically numbers with a decimal where the period is not at the same place for each number. So you could work with 53.21 and 589.4 as opposed to fixed point where the period is always at the same place for everyone :)

So that number would be 4 bytes?
Schrodinger's cat walks into a bar... and doesn't.

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Function
« Reply #18 on: July 06, 2012, 02:06:25 pm »
yes.

Offline danny90444

  • LV3 Member (Next: 100)
  • ***
  • Posts: 41
  • Rating: +0/-0
  • Physics :)
    • View Profile
    • facebook
Re: Function
« Reply #19 on: July 08, 2012, 08:14:22 pm »
thanks
Schrodinger's cat walks into a bar... and doesn't.