In binary a MB is 2^20=1,048,576 bytes, a KB is 2^10=1024 bytes, and a GB is 2^30=1,073,741,824 bytes.
I'm going to take a guess at this but if the manufacturer claimed it at 40Gigs while maintaining a 1Gig to 1,000,000,000 bytes ratio, the hard drive should be formated at 40,000,000,000 / 2^30 = 37.253 true(binary) GB.