[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

1690.0. "rounding?" by CSC32::J_HENSON (Faster than a speeding ticket) Wed Nov 04 1992 19:45

I've been asked a question about rounding floating point numbers and
I'm stuck.  I hope that someone in this conference can help me.

The customer is converting an application from a PDP to a Vax.  The
PDP code was written in assembler, but he is writing the Vax code
in Vax C.  Apparently, he is doing a lot of numerical calculations,
and is claiming that his results are wrong because of rounding.  He
wants to know if there is a way to specify the rounding algorithm.
In particular, he referenced functions that are available from
C on Ultrix/RISC called get_fpc_csr (or crs, I'm not sure) and
set_fpc_crs.  He claims that these functions allow him to specify
that numeric rounding is done either 1)toward 0, 2) toward positive
infinity, or 3) toward negative infinity.

I don't even know what he's talking about.  He could be yanking my
chain for all I know.  Does this mean anything to anyone?  If so,
do you have any idea of how to specify this on a Vax/VMS system?

Thanks,

Jerry
T.RTitleUserPersonal
Name
DateLines
1690.1IEEE FloatCRAONE::GRIESWed Nov 04 1992 20:0722
     <<< Note 1690.0 by CSC32::J_HENSON "Faster than a speeding ticket" >>>
                                 -< rounding? >-

! In particular, he referenced functions that are available from
! C on Ultrix/RISC called get_fpc_csr (or crs, I'm not sure) and
! set_fpc_crs.  He claims that these functions allow him to specify
! that numeric rounding is done either 1)toward 0, 2) toward positive
! infinity, or 3) toward negative infinity.

He is talking about IEEE float point. there are rounding control bits,

  0= round to nearest or even
  1= round down (-oo)
  2= round up (+oo)
  3= chop (truncate toward zero)

This is not available on Vaxes(round to nearest only).

It was not available on PDP's.

He may or may not need this rounding control.

1690.2ThanksCSC32::J_HENSONFaster than a speeding ticketThu Nov 05 1992 12:426
>>                      <<< Note 1690.1 by CRAONE::GRIES >>>
>>                                -< IEEE Float >-

Thanks,

Jerry
1690.3are the old results good?RANGER::BRADLEYChuck BradleyThu Nov 05 1992 16:5412
it sounds like the application uses the Unix C math library.
i have heard several claims that the accuracy is not what you might want 
to expect.  i can not confirm or deny those rumors, but it would not
surprise me if they were true.  there have been many cases where old results 
were considered good and new results wrong, when in fact the old
results were highly inaccurate. i think it was lynn yarbrough who
reported one such incident here or in warstories, where the old results
had zero significant bits.  this does not mean your customer is wrong.

i've never heard of a pdp-11 with ieee floating point.
is it a third party addition?

1690.4RDVAX::GRIESThu Nov 05 1992 18:568
! i've never heard of a pdp-11 with ieee floating point.
! is it a third party addition?

I believe that the pdp-11 has round towards zero (truncate)
which will give better results for things like newton iterations.