Add These Functions/Keywords To PureBasic?
Add These Functions/Keywords To PureBasic?
Should these functions/keywords be added to a future version of PureBasic?
EXP(X)
SGN(X)
PI
-- POLL QUESTION EDITED TO REFLECT INCLUSION OF ACOS(), ASIN() AND ATAN() --
EXP(X)
SGN(X)
PI
-- POLL QUESTION EDITED TO REFLECT INCLUSION OF ACOS(), ASIN() AND ATAN() --
Last edited by chris319 on Fri Feb 24, 2006 12:56 am, edited 2 times in total.
> Are not those last 3 already part of PB?
Yes. ACos, ASin, and ATan have existed since at least v3.94:
http://www.purebasic.com/documentation/math/index.html
Also, I was certain the constant #PI existed at one time, but I get an error
with v4.00 Beta 3 if I try to use it... surely I couldn't have been dreaming?
EDIT: Ah, here is where I saw it in the manual:
http://www.purebasic.com/documentation/ ... mulas.html
It says to use PI, but I do "Debug PI" it returns 0 for v4.00 Beta 3. Looks
like it needs fixing for v4.00 Final.
Yes. ACos, ASin, and ATan have existed since at least v3.94:
http://www.purebasic.com/documentation/math/index.html
Also, I was certain the constant #PI existed at one time, but I get an error
with v4.00 Beta 3 if I try to use it... surely I couldn't have been dreaming?
EDIT: Ah, here is where I saw it in the manual:
http://www.purebasic.com/documentation/ ... mulas.html
It says to use PI, but I do "Debug PI" it returns 0 for v4.00 Beta 3. Looks
like it needs fixing for v4.00 Final.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
-
Jan Vooijs
- Enthusiast

- Posts: 196
- Joined: Tue Sep 30, 2003 4:32 pm
- Location: The Netherlands
PB
Here is PI:
Now hows that a program in one line giving PI!!!!
The answer is: 3.1415927410125732
Here is PI:
Code: Select all
Debug ACos(-1)
The answer is: 3.1415927410125732
Life goes to Fast, Enjoy!!
PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!
AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!
AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
> Here is PI:
> Debug ACos(-1)
Hehe, and here's a macro for it (until Fred fixes the PI variable):

> Debug ACos(-1)
Hehe, and here's a macro for it (until Fred fixes the PI variable):
Code: Select all
Macro Pie
ACos(-1)
EndMacro
Debug Pie
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
Ah.
I think it meant Pi in a general sense as it also shows the Acos(-1) to get Pi. I just tried in 3.94 and pi = 0, "pi" being a long, pi.l
Regardless, we now have pi in several flavours. And macros are going to save Fred and team from writing some commands/fielding some requests down the track, I think.
I think it meant Pi in a general sense as it also shows the Acos(-1) to get Pi. I just tried in 3.94 and pi = 0, "pi" being a long, pi.l
Regardless, we now have pi in several flavours. And macros are going to save Fred and team from writing some commands/fielding some requests down the track, I think.
@}--`--,-- A rose by any other name ..
This is from the online documentation for 3.94:
No PI.
Bottom line: PI, EXP() AND SGN() are not needed. They are not needed because ... ?
Code: Select all
Command Index
ACos
ASin
ATan
Abs
Cos
Int
Log
Log10
Pow
Round
Sin
Sqr
TanBottom line: PI, EXP() AND SGN() are not needed. They are not needed because ... ?
I would expect PI to be a float or a double, wouldn't you?pi = 0, "pi" being a long, pi.l
> No PI
Well the manual gives an example in "PureBasic code" as you can see:
So I thought PI was a reserved variable or something. As I never had to use
PI, I never tested it before, and just assumed it worked per the above code.
But good to see that Fred has officially added it as #PI for the next release.
Well the manual gives an example in "PureBasic code" as you can see:
Code: Select all
'PI' stands for the constant value "PI = 3.1415...". An example for realizing
such a formula in PureBasic code: A = PI*r^2 will be A = PI*Pow(r,2)
PI, I never tested it before, and just assumed it worked per the above code.
But good to see that Fred has officially added it as #PI for the next release.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
-
Jan Vooijs
- Enthusiast

- Posts: 196
- Joined: Tue Sep 30, 2003 4:32 pm
- Location: The Netherlands
Your version looks more like a-PIE-in-the-SkyPB wrote:> Here is PI:
> Debug ACos(-1)
Hehe, and here's a macro for it (until Fred fixes the PI variable):
Code: Select all
Macro Pie ACos(-1) EndMacro Debug Pie
Jan V. (no pun intended)
Life goes to Fast, Enjoy!!
PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!
AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!
AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)

