modulo in scripting language
-
oxyredox
- Member
- Posts: 44
- Location: Paris
- Contact:
hi folks!
I'm working on a patch aiming at some special management for a cicular speaker arrangement. I've searched through the brilliant sripting tutorial but could'nt find any mention of the modulo opeator which is wohever quite common in Pascal (if I remember well).
I can create the function within the script, but I guess my script would be much more efficient if it was a built-in function.
Am I wrong or does it exist?
I'm working on a patch aiming at some special management for a cicular speaker arrangement. I've searched through the brilliant sripting tutorial but could'nt find any mention of the modulo opeator which is wohever quite common in Pascal (if I remember well).
I can create the function within the script, but I guess my script would be much more efficient if it was a built-in function.
Am I wrong or does it exist?
- senso
- Site Admin
- Posts: 4434
- Location: France
- Contact:
n := m MOD p; // modulo
n := m DIV p; // integer division
senso+++
n := m DIV p; // integer division
senso+++
Olivier Sens
www.brainmodular.com
www.brainmodular.com
-
oxyredox
- Member
- Posts: 44
- Location: Paris
- Contact:
THanx,
I had tried " n := m mod p;" and it could'nt compile...
but now that I think of it, it must have been a problem of type since m was a float...
Other question, I tried a script with a declaration such as
var n : extended;
and the compilator asnwers
extended no such type
where is the problem ?
I had tried " n := m mod p;" and it could'nt compile...
but now that I think of it, it must have been a problem of type since m was a float...
Other question, I tried a script with a declaration such as
var n : extended;
and the compilator asnwers
extended no such type
where is the problem ?
- senso
- Site Admin
- Posts: 4434
- Location: France
- Contact:
in Usine V4 on the Single type is allowed.
In the V5 you'll be able to user Single, Double & Extended.
...and will be 50x faster....
In the V5 you'll be able to user Single, Double & Extended.
...and will be 50x faster....
Olivier Sens
www.brainmodular.com
www.brainmodular.com
-
oxyredox
- Member
- Posts: 44
- Location: Paris
- Contact:
I can't wait!
- senso
- Site Admin
- Posts: 4434
- Location: France
- Contact:
ok, You'll receive a mail to the beta version.
Olivier Sens
www.brainmodular.com
www.brainmodular.com
-
oxyredox
- Member
- Posts: 44
- Location: Paris
- Contact:
groovy!
-
amiga909
- Member
- Posts: 324
u can do type casts, btw.oxyredox wrote:THanx,
I had tried " n := m mod p;" and it could'nt compile...
but now that I think of it, it must have been a problem of type since m was a float...
Other question, I tried a script with a declaration such as
var n : extended;
and the compilator asnwers
extended no such type
where is the problem ?
if i remember correctly its for example:
a := (int) b;
