Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts
Thursday, June 23, 2011
Wednesday, June 22, 2011
OO Programming & TDD: Useful Links
OO Design Principles
http://mmiika.wordpress.com/oo-design-principles/
Effective Tests: Test Doubles
http://www.aspiringcraftsman.com/2011/05/16/effective-tests-test-doubles/
The Art of Separation of Concerns
http://www.aspiringcraftsman.com/2008/01/03/art-of-separation-of-concerns/
http://mmiika.wordpress.com/oo-design-principles/
Effective Tests: Test Doubles
http://www.aspiringcraftsman.com/2011/05/16/effective-tests-test-doubles/
The Art of Separation of Concerns
http://www.aspiringcraftsman.com/2008/01/03/art-of-separation-of-concerns/
Friday, June 17, 2011
Saturday, August 01, 2009
Defining INT_MIN
A bit of googling revealed that above warning can be dangerous. To understand the underlying problem, here is my own version of INT_MIN.
#define INT32_MIN -2147483648
As 2147483648 is greater than max 32-bit signed int value (MAX_INT), it is treated as unsigned int
if ( 1 > INT32_MIN ) // comparing two unsigned values
std::cout << "I am sure, 1 gt INT32_MIN";
else
std::cout << "Surprse! it says, 1 lt INT32_MIN";
#define INT32_MIN (-2147483647 - 1) // don't forget to put the braces around
1. More detailed explanation is available here
2.
Labels:
INT_MIN,
limits.h,
programming,
warning C4146
Subscribe to:
Comments (Atom)