From dmurdoch@pair.com  Wed Jan  8 13:01:02 2003
From: dmurdoch@pair.com (Duncan Murdoch)
Date: Wed Jan  8 13:01:02 2003
Subject: [Rd] Undocumented bahavior of as.integer() (PR#2430)
In-Reply-To: <200301081051.LAA25597@pubhealth.ku.dk>
References: <200301081051.LAA25597@pubhealth.ku.dk>
Message-ID: <0k4o1v4rvtfrhsj6546fujmdvrfpsogc4k@4ax.com>

On Wed, 8 Jan 2003 11:51:22 +0100 (MET), you wrote:

>   >>  "A6.3 Integer and Floating"
>   >>  
>   >>  When a value of floating type is converted to integral type,
>   >>  the fractional part is discarded. ...................
>
>Hence this is (fortunately!) part of the C standard.
>But I really think any decent programming language would do it
>like that (many would not allow implicit coercion though..).

The dialects of Pascal that I use are pretty decent, but they don't
allow casting of floats to integers because of this ambiguity.  You
need to say round() or trunc() explicitly.  I'd think any decent
programming language would do that :-)

Duncan Murdoch



[Rd] Undocumented bahavior of as.integer() (PR#2430)
Duncan Murdoch