Name: Anonymous 2009-03-16 8:40
i++; versus i+=1; versus i=i+1;Discuss.
i++; versus i+=1; versus i=i+1;++i;
++i for EXTREME PERFORMANCE
i=i+1 deserves a fate worse than a fate worse than death. i++ FTW
i -=- 1;
function incrementation_numeric(){
if(isNaN(arguments[0]))
{
return 'Not a number'
}else{
var bnum=new Number(arguments[0]+1)
if(isNaN(bnum))
{
return 'Out of range'
}else{
return bnum
}
}
}
let i' = succ i
for(char *c := NULL; i>0; --i){
int j;
if (c) j := strlen(c); else j := 1;
realloc(c, ++j);
c[j-2] := ' '; c[j-1] := '\0';
}
i := strlen(c); free(c);
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1gpg2.-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
iEYEARECAAYFAkm+k70ACgkQdszBNMXUyxJrpwCgnMCVQX5xD1hOU1I28CZQcnr4
Ng4An0+5hO8G6sYnaw9jHRQUAv4WynCD
=ZDxf
-----END PGP SIGNATURE-----
newtype State s a = State { runState :: (s -> (a,s)) }
instance Monad (State s) where
return a = State $ \s -> (a,s)
(State x) >>= f = State $ \s -> let (v,s') = x s in runState (f v) s'
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1⑄ Please sign your posts! ⑄-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
iEYEARECAAYFAkm+oG4ACgkQdszBNMXUyxJFwgCfb4yLHyO4HLQwe5JOOtj04IdD
A3IAoNcxF7/I8E4IXlmKgIOsFJ7JFFHE
=e6vw
-----END PGP SIGNATURE-----
modifySTRef i (1+)
inc eax
(incf a)
INC INC Increment memory by one INC
N Z C I D V
Operation: M + 1 -> M / / _ _ _ _
(Ref: 10.6)
+----------------+-----------------------+---------+---------+----------+
| Addressing Mode| Assembly Language Form| OP CODE |No. Bytes|No. Cycles|
+----------------+-----------------------+---------+---------+----------+
| Zero Page | INC Oper | E6 | 2 | 5 |
| Zero Page,X | INC Oper,X | F6 | 2 | 6 |
| Absolute | INC Oper | EE | 3 | 6 |
| Absolute,X | INC Oper,X | FE | 3 | 7 |
+----------------+-----------------------+---------+---------+----------+
INX INX Increment Index X by one INX
N Z C I D V
Operation: X + 1 -> X / / _ _ _ _
(Ref: 7.4)
+----------------+-----------------------+---------+---------+----------+
| Addressing Mode| Assembly Language Form| OP CODE |No. Bytes|No. Cycles|
+----------------+-----------------------+---------+---------+----------+
| Implied | INX | E8 | 1 | 2 |
+----------------+-----------------------+---------+---------+----------+
BASIC TO MACHINE LANGUAGE 243
~
INY INY Increment Index Y by one INY
Operation: X + 1 -> X N Z C I D V
/ / _ _ _ _
(Ref: 7.5)
+----------------+-----------------------+---------+---------+----------+
| Addressing Mode| Assembly Language Form| OP CODE |No. Bytes|No. Cycles|
+----------------+-----------------------+---------+---------+----------+
| Implied | INY | C8 | 1 | 2 |
+----------------+-----------------------+---------+---------+----------+