Added "max" and "min" constants to the primitive types which represent the

largest and smallest representable values.  Accessible directly and via pTraits.
This commit is contained in:
henry
2009-01-23 08:35:29 +00:00
parent e78671dea4
commit 3be01b9e86
28 changed files with 120 additions and 24 deletions

View File

@ -430,10 +430,7 @@ Type max(const FieldField<Field, Type>& f)
}
else
{
WarningIn("max(const FieldField<Field, Type>&) const")
<< "empty fieldField, returning zero" << endl;
return pTraits<Type>::zero;
return pTraits<Type>::min;
}
}
@ -464,10 +461,7 @@ Type min(const FieldField<Field, Type>& f)
}
else
{
WarningIn("min(const FieldField<Field, Type>&) const")
<< "empty fieldField, returning zero" << endl;
return pTraits<Type>::zero;
return pTraits<Type>::max;
}
}