[sv-bc] [Fwd: [sv-ec] Integer to real conversion]

From: Neil Korpusik <Neil.Korpusik_at_.....>
Date: Wed May 31 2006 - 14:32:43 PDT
Copying sv-bc since it appears that this belongs in their area.

Neil

-------- Original Message --------
Subject: [sv-ec] Integer to real conversion
Date: Wed, 31 May 2006 11:46:24 -0400
From: Geoffrey.Coram <Geoffrey.Coram@analog.com>
To: sv-ec@eda.org

Hi-
The 1364-2005 LRM has two sections that appear to be essentially
the same, 3.5.3 and 4.8.2 (see below).  Note that the first two
sentences are identical.

I think 3.5.3 should be removed; it doesn't seem appropriate to
have this in the "Lexical Conventions" clause.  It might be good
to move the examples into 4.8.2.

-Geoffrey



3.5.3 Conversion

Real numbers shall be converted to integers by rounding the real number
to the nearest integer, rather than by truncating it. Implicit conversion
shall take place when a real number is assigned to an integer. The ties
shall be rounded away from zero. For example:
  - The real numbers 35.7 and 35.5 both become 36 when converted to an
    integer and 35.2 becomes 35.
  - Converting -1.5 to integer yields -2, converting 1.5 to integer
    yields 2.


4.8.2 Conversion

Real numbers shall be converted to integers by rounding the real number
to the nearest integer, rather than by truncating it. Implicit conversion
shall take place when a real number is assigned to an integer. If the
fractional part of the real number is exactly 0.5, it shall be rounded
away from zero.

Implicit conversion shall take place when an expression is assigned to a
real. Individual bits that are x or z in the net or the variable shall be
treated as zero upon conversion.

See 17.8 for a discussion of system tasks that perform explicit conversion.
Received on Wed May 31 14:32:23 2006

This archive was generated by hypermail 2.1.8 : Wed May 31 2006 - 14:33:19 PDT