Page 1 of 2 12>
Topic Options
#81640 - 2003-05-23 08:59 AM The Math Functions Wishlist... Part I - The List
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Think it was mentioned before, but regarding the 'new' possibilities with kixforms it's about time for some functionality enhancement (supporting floating point numbers was a step in the right direction) .... soooo ... how about intrinsic:

  • sin()
  • cos()
  • tan()
  • as well as their corresponding functions (asin() acos() atan() )
  • π (Pi as ummm ... a constant ?)
  • e (as well)
  • pwr() (supporting floating point operations of course)
  • sqrt() (cdbl-enabled as well)
functions ?
Anyone else to enhance this list ?
{Maybe some statistical functions for MCA ? [Big Grin] }
IF YOU FEEL LIKE TALKING ABOUT THAT, PLEASE GO HERE

[ 26. May 2003, 09:59: Message edited by: Jochen ]
_________________________



Top
#81641 - 2003-06-02 10:23 PM Re: The Math Functions Wishlist... Part I - The List
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
you looking for internal kixtart.exe support or UDF's?

UDF's might make for interesting projects [Smile]

I know when I made this SQRT() it was a learning experience to say the least.

Top
#81642 - 2003-06-02 10:31 PM Re: The Math Functions Wishlist... Part I - The List
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ummm ... intrinsic is the word here

Or can you riddle this? :

$x = sqrt(42.23)

[Wink]
_________________________



Top
#81643 - 2003-06-02 10:38 PM Re: The Math Functions Wishlist... Part I - The List
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
err.... using the above SQRT() function I get this.

code:
$x = sqrt(42.23)
? $x

6.49846135635198

my trusty MS calculator gives me
6.4984613563519788003088119713467

Top
#81644 - 2003-06-02 10:45 PM Re: The Math Functions Wishlist... Part I - The List
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
[Roll Eyes]

Sure, sorry!

It was of course the pwr() thing I played with some time later that is only with pain to get cdbl-aware...

Not to speak of sin() etc.

[ 02. June 2003, 22:47: Message edited by: Jochen ]
_________________________



Top
#81645 - 2003-06-02 10:59 PM Re: The Math Functions Wishlist... Part I - The List
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
you mean this? Link

code:
;42.23^4
$x = sqr(42.23,4)
? $x

3180418.90045441

ms calc returns = 3180418.90045441

Top
#81646 - 2003-06-02 11:05 PM Re: The Math Functions Wishlist... Part I - The List
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
those are the only 2 that I have done.... but i am sure that the others can be done too.
Top
#81647 - 2003-06-02 11:11 PM Re: The Math Functions Wishlist... Part I - The List
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Fair Cop,

but how about :

42.23^4.7

The pain starts ...
_________________________



Top
#81648 - 2003-06-02 11:20 PM Re: The Math Functions Wishlist... Part I - The List
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
hmmmmmmm
Top
#81649 - 2005-08-31 03:41 AM Re: The Math Functions Wishlist... Part I - The List
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ping pong.
can't forget Sqrt() nor Pow()
_________________________
!

download KiXnet

Top
#81650 - 2005-09-08 10:19 PM Re: The Math Functions Wishlist... Part I - The List
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
Not quite as profound as what's listed above, but these math shortcuts would rock.

$x++
++$x
$x--
--$x
$x+=(expr)
etc., etc.
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#81651 - 2005-09-08 10:27 PM Re: The Math Functions Wishlist... Part I - The List
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yes.
been waiting for someone to post a suggestion about these.
I'm totally with you about these!


Edited by Jooel (2005-09-08 10:27 PM)
_________________________
!

download KiXnet

Top
#81652 - 2005-09-08 10:58 PM Re: The Math Functions Wishlist... Part I - The List
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
jtokach ,Jooel wanted me to post those but I told him that they were too Perlish and I might get bashed. But I want them too.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#81653 - 2005-09-08 11:07 PM Re: The Math Functions Wishlist... Part I - The List
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
What does the double plus or minus signify?
Top
#81654 - 2005-09-08 11:08 PM Re: The Math Functions Wishlist... Part I - The List
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
$x++

equals

$x=$x+1
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#81655 - 2005-09-08 11:11 PM Re: The Math Functions Wishlist... Part I - The List
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
Quote:

jtokach ,Jooel wanted me to post those but I told him that they were too Perlish and I might get bashed. But I want them too.




It might be a nice change to get some C based crap in here vs. all the VB.
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#81656 - 2005-09-08 11:11 PM Re: The Math Functions Wishlist... Part I - The List
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
ack! I'll pass. Aside from golf... what's the advantage?
Top
#81657 - 2005-09-09 12:36 AM Re: The Math Functions Wishlist... Part I - The List
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
It's been around in C for +30 years; apparently those guys were super lazy too.

The only advantages that I could see, besides the lazy factor, are that it should be faster for the interpreter to simply increment the variable rather than setting the left side var equal to itself and then performing the math. And someone might benefit from the ability to choose weather to pre increment/decrement vs. post increment/decrement. I can't think of any examples off hand.

Obviously, these VB type For loops weren't built with this in mind. Consider in C:

for(hi=100,lo=0;hi>=lo;hi--,lo++)

This C For loop most accurately translates to a While statement in Kix.

$hi=100
$lo=0
While $hi>=$lo
$hi=$hi-1
$lo=$lo+1
Loop

Hmmm...
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#81658 - 2005-09-09 12:58 AM Re: The Math Functions Wishlist... Part I - The List
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, most importantly something like the code below will benefit:
Code:

$myTextFile = readFile("c:\pagefile.sys") ; you need to udf for this :p
$myTextFile = $myTextFile + "some text more"


consider moving around some hundreds of megabytes of crap.
when you could simply append the text with:
Code:

$myTextFile = readFile("c:\pagefile.sys") ; you need to udf for this :p
$myTextFile += "some text more"




pagefile.sys might not work as perfect example but you surely get the idea.
_________________________
!

download KiXnet

Top
#81659 - 2005-09-09 01:02 AM Re: The Math Functions Wishlist... Part I - The List
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
Absolutely.
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
Page 1 of 2 12>


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.072 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org