Unsigned arithmetic
- From: mojaveg@xxxxxxxxxx (Everett M. Greene)
- Date: Sun, 16 Apr 2006 10:27:11 PST
I've been having discussion recently about the interpretation
to be given to conversion of a float value to unsigned integer.
The question involves treatment of negative values. My position
is that the conversion is mathematically meaningless, so it's
an exercise for the student as to which way is "best". A case
can possibly be made for either using or ignoring the sign of
the float value, but the choice is arbitrary.
An example of converting -23.1 to unsigned integer. To me, it
just doesn't seem that the result should be 23 (ignoring the
sign) as opposed to 0xFFFFFFE9 (negating the value and treating
the result as unsigned).
.
- Prev by Date: Re: y = (ax + b)/(cx+d)
- Next by Date: Re: Fortran to find nearest point from set in 3-D
- Previous by thread: Fortran to find nearest point from set in 3-D
- Next by thread: New mathematics/physical sciences positions at http://jobs.phds.org, April 17, 2006
- Index(es):
Relevant Pages
|
Loading