[Insight-developers] NumericTraits for long long and __int64

Bradley Lowekamp blowekamp at mail.nih.gov
Mon Nov 23 11:09:25 EST 2009


Bill,

Sorry for not being clear. It appears to be an only a Borland compiler issues.

Thanks for taking a look.

Brad


On Nov 23, 2009, at 10:56 AM, Bill Lorensen wrote:

> Brad,
> 
> I can't tell from your note. Is this a Borland only problem? If so, I
> can take a look.
> 
> Bill
> 
> On Mon, Nov 23, 2009 at 10:14 AM, Bradley Lowekamp
> <blowekamp at mail.nih.gov> wrote:
>> Hello,
>> I have been working on adding NumericTraits for types long long and __int64.
>> To address the issue of size_t being type long long on win64, and to get a
>> more portable 64-bit integer.
>> The traits for type long long and unsigned long long seem to be working on
>> the systems which support the tyoe. std::numeric_limits is specialized and
>> the values seem to be set and printed ok in the NumericTraitsTest.
>> Unfortunately __int64 does not seem to be working right. It appears that the
>> Borland compiler is the only one where it is a fundamental type and it is
>> convertible to double. It does not have a specialized std::numeric_limits
>> defined. More problematic is the basic value of One and Zero set it
>> itkNumericTraits.cxx don't seem to be functioning correctly. The output of
>> itkNumericTraitsTest is:
>> 
>> itk::NumericTraits<__int64>
>> is_specialized: 0
>> digits: 0
>> digits10: 0
>> 
>> 	is_signed: 0
>> 	round_error(): 0
>> 	denorm_min(): 0
>> 	epsilon(): 0
>> 	min(): 0
>> 	max(): 0
>> 	IsPositive( One )0
>> 	IsNonpositive( One )1
>> 	IsNegative( One )1
>> 	IsNonnegative( One )0
>> 	Zero: 1072693248
>> 	One: 0
>> 	ZeroValue(): 1072693248
>> 	OneValue(): 0
>> 	max(__int64): 0
>> 	min(__int64): 0
>> 	NonpositiveMin(): 0
>> itk::NumericTraits<unsigned __int64>
>> 	is_specialized: 0
>> 	digits: 0
>> 	digits10: 0
>> 	is_signed: 0
>> 	round_error(): 0
>> 	denorm_min(): 0
>> 	epsilon(): 0
>> 	min(): 0
>> 	max(): 0
>> 	IsPositive( One )1
>> 	IsNonpositive( One )0
>> 	IsNegative( One )0
>> 	IsNonnegative( One )1
>> 	Zero: 0
>> 	One: 1
>> 	ZeroValue(): 0
>> 	OneValue(): 1
>> 	max(unsigned __int64): 0
>> 	min(unsigned __int64): 0
>> 	NonpositiveMin(): 0
>> 
>> Take note of the One and Zero values it "__int64".
>> I don't have access to the borland compiler, and don't know how to look into
>> this issue further. I am tempted to say that we just shouldn't support the
>> __int64 type as it'll make things simpler.
>> Brad
>> 
>> ========================================================
>> 
>> Bradley Lowekamp
>> 
>> Lockheed Martin Contractor for
>> 
>> Office of High Performance Computing and Communications
>> 
>> National Library of Medicine
>> 
>> blowekamp at mail.nih.gov
>> 
>> 
>> _______________________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Kitware offers ITK Training Courses, for more information visit:
>> http://kitware.com/products/protraining.html
>> 
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-developers
>> 
>> 

========================================================
Bradley Lowekamp  
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20091123/347637a8/attachment.htm>


More information about the Insight-developers mailing list