Re: checking if a floating point number is equal in value to an integer
- From: "Ugo" <ugotarta@xxxxxxxxxxx>
- Date: 30 Jan 2007 02:50:43 -0800
On Jan 30, 5:41 am, glen herrmannsfeldt <g...@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:
The aint() function has real type, giving the truncated value
as type real (of the appropriate kind for versions that support
kind). So I would suggest aint(a)==a as the test over
float(nint(a))==a.
And do not forget the standard intrinsic function anint, which gives
the closest whole number, like an integer, but of type real.
aint is analogous of int, but with real type
anint is analogous of nint, but with real type
.
- Follow-Ups:
- Re: checking if a floating point number is equal in value to an integer
- From: glen herrmannsfeldt
- Re: checking if a floating point number is equal in value to an integer
- References:
- checking if a floating point number is equal in value to an integer
- From: analyst41
- Re: checking if a floating point number is equal in value to an integer
- From: glen herrmannsfeldt
- checking if a floating point number is equal in value to an integer
- Prev by Date: Re: Handling large datasets in Fortran
- Next by Date: Re: Declaration to get 8-bit (or 16-bit) integer?
- Previous by thread: Re: checking if a floating point number is equal in value to an integer
- Next by thread: Re: checking if a floating point number is equal in value to an integer
- Index(es):