DEFECT: _fp_round sets incorrect rounding mode.

AFFECTS: Rounding mode affects all floating-point computations and
         narrowing conversions including int-to-float, double-to-float, and
         longlong-to-double.

PRESENT IN: These PalmOS versions were available for test: 3.1.1 3.1H3 3.3 3.5
            All tested versions have the defect.

TO REPLICATE: http://www.sleepless-night.com/cgi-bin/twiki/view/Main/_fp_roundB
ug
              contains details, test results and a Quartus Forth script that 
will
              test for the defect.

SUMMARY: ToNearest rounding mode is active after a device reset. _fp_round can
         then be used only to select TowardZero or Upward mode. Attempt to
         select Downward mode gives Upward instead. Subsequent calls to
         _fp_round can only produce Upward mode, regardless of the argument.
         Only a reset can restore ToNearest mode.

RELATED PROBLEMS:
1. The _fp_round return value is shifted 4 bits, apparently a known issue but
   contrary to documentation.
2. Allowing for the shift, the return value reflects the desired rounding mode
   passed to _fp_round, falsely indicating that the desired mode has been
   activated when in fact a different mode has been selected.

More details available in my first posting on the topic: 
news:46710@palm-dev-forum
a/k/a http://www.escribe.com/computing/pcpqa/m38616.html

PLEASE ADVISE OF PATCH OR WORKAROUND AVAILABILITY:

  How can an application select Downward rounding mode?

  How can an application select ToNearest, TowardZero, or Downward mode
  after another mode has been selected?

  Will the defect be corrected in a future OS version?

Chapman Flack


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to