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

Duncan Murdoch dmurdoch@pair.com
Wed Jan 8 13:01:02 2003


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