|
|
|||||||
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:
Anyone else to enhance this list ? {Maybe some statistical functions for MCA ? } IF YOU FEEL LIKE TALKING ABOUT THAT, PLEASE GO HERE [ 26. May 2003, 09:59: Message edited by: Jochen ] |
||||||||
|
|
|||||||
you looking for internal kixtart.exe support or UDF's? UDF's might make for interesting projects I know when I made this SQRT() it was a learning experience to say the least. |
||||||||
|
|
|||||||
Ummm ... intrinsic is the word here Or can you riddle this? : $x = sqrt(42.23) |
||||||||
|
|
|||||||
err.... using the above SQRT() function I get this. code:6.49846135635198$x = sqrt(42.23) my trusty MS calculator gives me 6.4984613563519788003088119713467 |
||||||||
|
|
|||||||
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 ] |
||||||||
|
|
|||||||
you mean this? Link code:3180418.90045441;42.23^4 ms calc returns = 3180418.90045441 |
||||||||
|
|
|||||||
those are the only 2 that I have done.... but i am sure that the others can be done too. |
||||||||
|
|
|||||||
Fair Cop, but how about : 42.23^4.7 The pain starts ... |
||||||||
|
|
|||||||
hmmmmmmm |
||||||||
|
|
|||||||
ping pong. can't forget Sqrt() nor Pow() |
||||||||
|
|
|||||||
Not quite as profound as what's listed above, but these math shortcuts would rock. $x++ ++$x $x-- --$x $x+=(expr) etc., etc. |
||||||||
|
|
|||||||
yes. been waiting for someone to post a suggestion about these. I'm totally with you about these! |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
What does the double plus or minus signify? |
||||||||
|
|
|||||||
$x++ equals $x=$x+1 |
||||||||
|
|
|||||||
Quote: It might be a nice change to get some C based crap in here vs. all the VB. |
||||||||
|
|
|||||||
ack! I'll pass. Aside from golf... what's the advantage? |
||||||||
|
|
|||||||
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... |
||||||||
|
|
|||||||
well, most importantly something like the code below will benefit: Code:
consider moving around some hundreds of megabytes of crap. when you could simply append the text with: Code:
pagefile.sys might not work as perfect example but you surely get the idea. |
||||||||
|
|
|||||||
Absolutely. |
||||||||
|
|
|||||||
Quote: All automation stems from laziness. Anyway, to add my two cents...If i remember my c++ correctly (which i might not) the ++ operator is unary. So if you wanted to increment a variable and then compare it to some value, you could do something like if(++x == y) {...} instead of $x = $x+1 if $x = $y ... endif Man, i really miss c++ |
||||||||
|
|
|||||||
Sure, and alternatively: if(x++ == y) {...} instead of if $x = $y ... endif $x = $x+1 or if $x = $y $x = $x+1 ... endif or if $x = $y $x = $x+1 ... endif $x = $x+1 |
||||||||
|
|
|||||||
Without a doubt - some of (my) absolute favorites features of C |
||||||||
|
|
|||||||
Actually it can be more than that. $i = 0 $j = 0 ? $i++ ; prints 0 ? ++$j ; prints 1 |