Page 1 of 1

Power operator for PB 3.80

Posted: Thu Oct 02, 2003 3:02 pm
by Psychophanta
Please, what about a power operator "^" instead of pow() function just now you are working for 3.80 version?
If you add ^ for power arithmetic operations you can remove pow() function.
Keep in mind too that just an operator is better for readability...


Thanx Fred!

_______________
AL

Posted: Thu Oct 02, 2003 4:23 pm
by blueznl
i second that! i was quite surprised i couldn't use 2^2 etc.

ehm, and plz for floats as well as integers and even constants...

for example:

a.l = 2 ^ 2
a.f = 2 ^ 2

#DTAREADY = 2 ^ 2

but then again, perhaps i ask too much...

Posted: Thu Oct 23, 2008 10:36 pm
by Psychophanta
More good reasons to deprecate Pow:
- Pow is not a typical BASICs word. Few BASIC dialects use it instead ^
- PB syntax philosophy supports keywords as entire names, Pow is an incomplete word.
- There is an inconsitence with other operators. In order to have coherence there should replace '*' by Mul(), '/' by Div(), '+' by Sum(), etc.

Posted: Thu Oct 23, 2008 10:49 pm
by rsts
Mul and div are complete words?

You request seems to contradict itself - replace pow with ^ but replace * with div.

Posted: Thu Oct 23, 2008 11:03 pm
by Kaeru Gaman
I understand what he means:
If power stays Pow(), devide should be changed to Div() etc..


... me, I don't care ...

in fact, Pow() is on a Level like Sqr() or Log().
not an operation on the level like division or multiplication.
it's not even a bijective transformation, like division and multiplication are.
so, it's not that big argument I think.