Page 2 of 2 <12
Topic Options
#81660 - 2005-09-09 01:08 AM Re: The Math Functions Wishlist... Part I - The List
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
Quote:


It's been around in C for +30 years; apparently those guys were super lazy too.





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++

Top
#81661 - 2005-09-09 04:45 PM Re: The Math Functions Wishlist... Part I - The List
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
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
_________________________
-Jim

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

Top
#81662 - 2005-09-09 05:07 PM Re: The Math Functions Wishlist... Part I - The List
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Without a doubt - some of (my) absolute favorites features of C
Top
#81663 - 2005-09-09 09:51 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
Actually it can be more than that.

$i = 0
$j = 0
? $i++ ; prints 0
? ++$j ; prints 1
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 2 of 2 <12


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

Who's Online
0 registered and 628 anonymous users online.
Newest Members
Raoul, Timothy, Jojo67, MaikSimon, kvn317
17875 Registered Users

Generated in 0.056 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

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