Re: Rounding of results in conversion of IEEE floats to integers
- From: "*** T. Winter" <***.Winter@xxxxxx>
- Date: Mon, 18 Dec 2006 14:18:40 GMT
In article <12od5jj1hq7dt52@xxxxxxxxxxxxxxxxxx> Dan Kelly <knivesandstabbingweapons@xxxxxxxxxxx> writes:
....
As I understand, floating point conversion should be provided as a
fundamental operation in an IEEE compliant FP implementation.
Furthermore, in conversions the rounding schemes below should apply in
the same way that they are applied to the result of one of the
operations (+,-,*,/).
That is only the case if you use IEEE compliant conversion routines.
direct_conv = (int)float_a;
add_conv = (int)(float_b + float_c);
These are casts, and by the C standard in such a case the fractional
part should be removed, i.e., there is an truncation in the direction
of 0 involved.
--
*** t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~***/
.
- Follow-Ups:
- Conversion of IEEE floats to integers and intel/amd64 differences
- From: brandon thompson
- Conversion of IEEE floats to integers and intel/amd64 differences
- References:
- Rounding of results in conversion of IEEE floats to integers
- From: Dan Kelly
- Rounding of results in conversion of IEEE floats to integers
- Prev by Date: Rounding of results in conversion of IEEE floats to integers
- Next by Date: Conversion of IEEE floats to integers and intel/amd64 differences
- Previous by thread: Rounding of results in conversion of IEEE floats to integers
- Next by thread: Conversion of IEEE floats to integers and intel/amd64 differences
- Index(es):