473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

IEEE-754

IEEE-754 Arithmetic:
Most real numbers can't be stored exactly on the computer, but there can
be stated the range within which a machine number lies.

For the following example, I assume double precision and the round mode
in effect to be 'round to nearest' and that the number lies within the
normalized range:

Definitions:
x := real number
round(x) := correctly rounded normalized number
eps := machine epsilon (2^(-52) for double precision)
abs(x) := absolute value of x

That is:

round(x) = x*(1 + delta)

with delta:

abs(delta) <= 1/2*eps (round to nearest)

i.d. abs(delta) <= 2^(-53) (double precision)

abs(delta) corresponds to the relative rounding error.

Now I can state the range including round(x):

-----------------------------------------
x*(1-2(-53)) <= round(x) <= x*(1+2^(-53))
-----------------------------------------

Is this the correct range according to my assumptions?

Thanks a lot
Roman
Aug 23 '07 #1
5 3771
On 2007-08-23 12:54, Roman Töngi wrote:
IEEE-754 Arithmetic:
Most real numbers can't be stored exactly on the computer, but there can
be stated the range within which a machine number lies.

For the following example, I assume double precision and the round mode
in effect to be 'round to nearest' and that the number lies within the
normalized range:

Definitions:
x := real number
round(x) := correctly rounded normalized number
eps := machine epsilon (2^(-52) for double precision)
abs(x) := absolute value of x

That is:

round(x) = x*(1 + delta)

with delta:

abs(delta) <= 1/2*eps (round to nearest)

i.d. abs(delta) <= 2^(-53) (double precision)

abs(delta) corresponds to the relative rounding error.

Now I can state the range including round(x):

-----------------------------------------
x*(1-2(-53)) <= round(x) <= x*(1+2^(-53))
-----------------------------------------

Is this the correct range according to my assumptions?
These kinds of questions that have noting to do with C++ (since C++ does
not require IEEE-754) are better asked in comp.programming.

--
Erik Wikström
Aug 23 '07 #2
Erik Wikström wrote:
On 2007-08-23 12:54, Roman Töngi wrote:
>IEEE-754 Arithmetic:
Most real numbers can't be stored exactly on the computer, but there can
be stated the range within which a machine number lies.

For the following example, I assume double precision and the round
mode in effect to be 'round to nearest' and that the number lies
within the
normalized range:

Definitions:
x := real number
round(x) := correctly rounded normalized number
eps := machine epsilon (2^(-52) for double precision)
abs(x) := absolute value of x

That is:

round(x) = x*(1 + delta)

with delta:

abs(delta) <= 1/2*eps (round to nearest)

i.d. abs(delta) <= 2^(-53) (double precision)

abs(delta) corresponds to the relative rounding error.

Now I can state the range including round(x):

-----------------------------------------
x*(1-2(-53)) <= round(x) <= x*(1+2^(-53))
-----------------------------------------

Is this the correct range according to my assumptions?

These kinds of questions that have noting to do with C++ (since C++ does
not require IEEE-754) are better asked in comp.programming.
How does C++ store numbers then?
Aug 23 '07 #3
Roman Töngi wrote:
Erik Wikström wrote:
>>
These kinds of questions that have noting to do with C++ (since C++
does not require IEEE-754) are better asked in comp.programming.
How does C++ store numbers then?
In an implementation dependent manner. The Standard does not impose any
requirements on *how* an implementation implements floating point
numbers. An implementation *may choose* to use IEEE-754 (I believe most
x86 compilers do so), but it is not required to (cf. VAX -- are there
any left out there?).
Aug 23 '07 #4
red floyd wrote:
:: Roman Töngi wrote:
::: Erik Wikström wrote:
::
::::
:::: These kinds of questions that have noting to do with C++ (since
:::: C++ does not require IEEE-754) are better asked in
:::: comp.programming.
::::
::: How does C++ store numbers then?
::
:: In an implementation dependent manner. The Standard does not
:: impose any requirements on *how* an implementation implements
:: floating point numbers. An implementation *may choose* to use
:: IEEE-754 (I believe most x86 compilers do so), but it is not
:: required to (cf. VAX -- are there any left out there?)

Probably not that many.

More important is IBM zSeries. Perhaps only 10.000 installations, but
big systems with BIG companies.

http://www-03.ibm.com/systems/z/
Bo Persson
Aug 23 '07 #5
Bo Persson wrote:
red floyd wrote:
:: An implementation *may choose* to use
:: IEEE-754 (I believe most x86 compilers do so), but it is not
:: required to (cf. VAX -- are there any left out there?)

Probably not that many.

More important is IBM zSeries. Perhaps only 10.000 installations, but
big systems with BIG companies.

http://www-03.ibm.com/systems/z/
Cool. I chose VAX simply because I *knew* it didn't use 754 floating
point. Didn't know that about the zSeries.

Aug 23 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bill | last post by:
Hello all, I found the following visual basic 6.0 source code on the web for displaying web cam video in a GUI. However, I want to display video from a camera which is hooked up through...
2
by: Norbert Nemec | last post by:
Hi there, is there any simple reason why IEEE special values are so poorly supported in python? Are there any serious efforts to change that? NaN and Inf are an extremely useful concept for...
7
by: i_vincent | last post by:
Hi all, Newbie Python programmer here, so please be patient. I have spent all day googling for an answer to my problem, but everything I try fails to work (or works from the Interpreter with a...
10
by: Mad Butch | last post by:
void Test() { float fValue = 0.5678f; // Value is 0.567800 double dValue = (double)fValue; // Value is 0.56779998540878 } Is there anyway I can round a float at 6 positions behind the...
2
by: Ingo Nolden | last post by:
Hi, I am not really sure wether there is a better group for this. I already tried a VC group, but they cannot tell me how other stdlibs are doing it. I tested a lot with inf and NaNs. I read...
1
by: GooglePoster | last post by:
Hello, I am looking for a function/utility to read in an IEEE value and convert this to decimal, for testing purposes. Also, I need to convert decimal values to IEEE values to send out on a...
2
by: Andre | last post by:
I read some place that for performance reasons, IEEE floating point standard has not been implemented by .NET and that different machine architectures may produce different results.. but what if...
1
by: Faezeh | last post by:
I want to read 4 byte with IEEE floating point format and convert to decimal number in vb.net, and need to function for shift bits to left in vb .net. 32 bit IEEE floating point has this format: ...
13
by: revuesbio | last post by:
Hi Does anyone have the python version of the conversion from msbin to ieee? Thank u
6
by: shreshta | last post by:
can anyone tell me where i could download the IEEE papers. Which site permits the download? IEEE site doesnt allow to download. thanks in advance
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.