Re: Floating Point Rounding Mode

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Duane Bozarth (dpbozarth_at_swko.dot.net)
Date: 01/26/05


Date: Wed, 26 Jan 2005 11:39:54 -0600

Brian Stone wrote:
>
> Does anyone know which floating point processor rounding mode various
> versions of VB use (nearest, up, down, truncate) when dealing with single
> and double data types? I'm trying to replace some old code running on an HP
> 3000. Thanks.

I'm not sure and was unable in a quick search to find an answer...

I've used some HP machines (mostly 1000's) but not the 3000. What,
specifically, is the issue? Any machine on an Intel will use the 80-bit
coprocessor and then truncate/round the result back to storage
precision. That is unlikely to reproduce the HP hardware to the final
bit irrespective of rounding mode.



Relevant Pages

  • Re: What is the fastest way of getting the fraction part of a floating point number?
    ... restore it when you're done. ... It is usually ) much faster to simply round, subtract and then correct if the rounding went the wrong way. ... This is particularly good if you know that the input always has the same sign, or if you want to always round up, not truncate. ... The x86-64 architecture defines better opcodes for this, including a directed round operation that is independent of the current rounding mode. ...
    (comp.lang.asm.x86)
  • Floating Point Rounding Mode
    ... versions of VB use (nearest, up, down, truncate) when dealing with single ... and double data types? ...
    (microsoft.public.vb.general.discussion)
  • Re: What is the fastest way of getting the fraction part of a floating point number?
    ... fst ... Unless you know the current rounding mode is "truncate", ...
    (comp.lang.asm.x86)
  • Re: Floating Point Rounding Mode
    ... >> single and double data types? ... "round up" in it's floating point calculations. ... Round nearest is the IEEE ... type conversions done by C and FORTRAN use the chop rounding mode, ...
    (microsoft.public.vb.general.discussion)
  • Re: IEEE-FP 0.5.2 - Rounding
    ... Only the functions listed are specified as "round to nearest". ... FLOOR is required to floor. ... default rounding mode. ...
    (comp.lang.forth)