Mercurial > projects > dstress
changeset 627:caa75b9cf2f4
Negative numbers are treated as Positive in compares.
David L. Davis <SpottedTiger@yahoo.com>
2005-08-10
news:dddj2k$lrr$1@digitaldaemon.com
author | thomask |
---|---|
date | Sat, 13 Aug 2005 20:54:43 +0000 |
parents | a57ea0ea4615 |
children | e72b992e95ea |
files | run/o/opCmp_05_A.d run/o/opCmp_05_B.d run/o/opCmp_05_C.d run/o/opCmp_05_D.d run/o/opCmp_05_E.d run/o/opCmp_05_F.d |
diffstat | 6 files changed, 209 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/opCmp_05_A.d Sat Aug 13 20:54:43 2005 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ David L. Davis <SpottedTiger@yahoo.com> +// @date@ 2005-08-10 +// @uri@ news:dddj2k$lrr$1@digitaldaemon.com +// @desc@ Negative numbers are treated as Positive in compares. + +module dstress.run.o.opCmp_05_A; + +int main(){ + if(128<0){ + assert(0); + } + + if(128<=0){ + assert(0); + } + + if(128>0){ + assert(1); + }else{ + assert(0); + } + + if(128>=0){ + assert(1); + }else{ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/opCmp_05_B.d Sat Aug 13 20:54:43 2005 +0000 @@ -0,0 +1,35 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ David L. Davis <SpottedTiger@yahoo.com> +// @date@ 2005-08-10 +// @uri@ news:dddj2k$lrr$1@digitaldaemon.com +// @desc@ Negative numbers are treated as Positive in compares. + + +module dstress.run.o.opCmp_05_B; + +int main(){ + if(-128<0){ + assert(1); + }else{ + assert(0); + } + + if(-128<=0){ + assert(1); + }else{ + assert(0); + } + + if(-128>0){ + assert(0); + } + + if(-128>=0){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/opCmp_05_C.d Sat Aug 13 20:54:43 2005 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ David L. Davis <SpottedTiger@yahoo.com> +// @date@ 2005-08-10 +// @uri@ news:dddj2k$lrr$1@digitaldaemon.com +// @desc@ Negative numbers are treated as Positive in compares. + +module dstress.run.o.opCmp_05_C; + +int main(){ + static if(-128<0){ + assert(1); + }else{ + assert(0); + } + + static if(-128<=0){ + assert(1); + }else{ + assert(0); + } + + static if(-128>0){ + assert(0); + } + + static if(-128>=0){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/opCmp_05_D.d Sat Aug 13 20:54:43 2005 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ David L. Davis <SpottedTiger@yahoo.com> +// @date@ 2005-08-10 +// @uri@ news:dddj2k$lrr$1@digitaldaemon.com +// @desc@ Negative numbers are treated as Positive in compares. + +module dstress.run.o.opCmp_05_D; + +int main(){ + static if(128<0){ + assert(0); + } + + static if(128<=0){ + assert(0); + } + + static if(128>0){ + assert(1); + }else{ + assert(0); + } + + static if(128>=0){ + assert(1); + }else{ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/opCmp_05_E.d Sat Aug 13 20:54:43 2005 +0000 @@ -0,0 +1,36 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ David L. Davis <SpottedTiger@yahoo.com> +// @date@ 2005-08-10 +// @uri@ news:dddj2k$lrr$1@digitaldaemon.com +// @desc@ Negative numbers are treated as Positive in compares. + +module dstress.run.o.opCmp_05_E; + +int main(){ + int i=128; + + if(i<0){ + assert(0); + } + + if(i<=0){ + assert(0); + } + + if(i>0){ + assert(1); + }else{ + assert(0); + } + + if(i>=0){ + assert(1); + }else{ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/opCmp_05_F.d Sat Aug 13 20:54:43 2005 +0000 @@ -0,0 +1,36 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ David L. Davis <SpottedTiger@yahoo.com> +// @date@ 2005-08-10 +// @uri@ news:dddj2k$lrr$1@digitaldaemon.com +// @desc@ Negative numbers are treated as Positive in compares. + +module dstress.run.o.opCmp_05_F; + +int main(){ + int i=-128; + + if(i<0){ + assert(1); + }else{ + assert(0); + } + + if(i<=0){ + assert(1); + }else{ + assert(0); + } + + if(i>0){ + assert(0); + } + + if(i>=0){ + assert(0); + } + + return 0; +}