INT(x) == 1 if x < 1?

Daniel Franke franke.daniel@gmail.com
Mon Oct 30 06:25:00 GMT 2006


On Sunday 29 October 2006 23:17, FX Coudert wrote:

> When you say "0.99999999", the compiler understands "the real number
> exactly representible for this kind (here, 4) that is closest to
> 0.99999999". It so happens that this number is 1.000000000000.

Wow, that was fast =)
Yes, I thought so, but then, there's another problem:

As the standard requires (13.14.85, F95 final draft), RANDOM_NUMBER() shall 
return a harvest x in the range 0 <= x < 1. Therefore, on REAL :: x; 
RANDOM_NUMBER(x), INT(x) must(?) equal zero. As I learned the hard way, this 
is not always true?!

	Daniel



More information about the Fortran mailing list