Re: Datatype checking in DotNET
- From: Hans-Peter Diettrich <DrDiettrich1@xxxxxxx>
- Date: Fri, 29 Jun 2007 13:15:03 +0200
Daniel Hobson wrote:
But what I am trying to achieve here is to ensure the data integrity, does the data meet the float bounds?????
For integers you could do a test like this:-
tempVal := StrToInt (fieldStr);
if (tempVal < low (IntImSavingToo )) or (tempVal > high (IntImSavingToo )) then
exit;
In contrast to integral types, floating point types have different bounds, or better: limitations. The only hard limit is the upper bound of the exponent, which can result in an infinity value, whereas a loss of significant digits or vanishing too-small values are "normal" events in dealing with floats.
Is there something I can use for floats, doubles and singles also???
You better use the native floating point type of .NET, and don't bother with the other types.
DoDi
.
- References:
- Datatype checking in DotNET
- From: Daniel Hobson
- Re: Datatype checking in DotNET
- From: Nicholas Sherlock
- Re: Datatype checking in DotNET
- From: Daniel Hobson
- Datatype checking in DotNET
- Prev by Date: Re: Entering timer for long process
- Next by Date: Re: Entering timer for long process
- Previous by thread: Re: Datatype checking in DotNET
- Next by thread: Re: Datatype checking in DotNET
- Index(es):
Relevant Pages
|