- #1

- 43

- 1

Wikipedia tells me that the machine epsilon is 2

^{−52}≈ 2.22e-16 for 64-bit

**IEEE 754 - 2008?**Is this the exact value on Python?

Outside of that, I'm not sure where to start.

- Thread starter BubblesAreUs
- Start date

- #1

- 43

- 1

Wikipedia tells me that the machine epsilon is 2

Outside of that, I'm not sure where to start.

- #2

SteamKing

Staff Emeritus

Science Advisor

Homework Helper

- 12,796

- 1,668

Programmers have written routines to test for the machine epsilon using various programming languages. You could probably do a Google search and find either a routine or a description of one to use in Python.

Wikipedia tells me that the machine epsilon is 2^{−52}≈ 2.22e-16 for 64-bit

IEEE 754 - 2008?Is this the exact value on Python?

Outside of that, I'm not sure where to start.

- #3

Mark44

Mentor

- 34,010

- 5,660

In Python v3.4.2, epsilon is 2.220446049250313e-16. The float_info member of the sys module contains this information.

Wikipedia tells me that the machine epsilon is 2^{−52}≈ 2.22e-16 for 64-bit

IEEE 754 - 2008?Is this the exact value on Python?

Outside of that, I'm not sure where to start.

- #4

- 43

- 1

I just tried out sys. and got the following:In Python v3.4.2, epsilon is 2.220446049250313e-16. The float_info member of the sys module contains this information.

>>> sys.float_info.epsilon

2.220446049250313e-16

>>> sys.float_info.min

2.2250738585072014e-308

I am looking for the smallest floating point number. Oddly, I was expecting the smallest floating point number to be greater than machin epsilon.

PS: Will try that out as well SteamKing.

- #5

Mark44

Mentor

- 34,010

- 5,660

Machine epsilon and the smallest floating point number are different things.I am looking for the smallest floating point number. Oddly, I was expecting the smallest floating point number to be greater than machin epsilon.

From the Python docs:

epsilon - difference between 1 and the least value greater than 1 that is representable as a float

min - minimum positive normalized float

- #6

- 43

- 1

Oh that makes sense. Now what I even more puzzling is that I'm supposed to find a min floating point such that, it plus 1 should not return 1. Interestingly, the output I am getting when adding min float and 1 is 1.Machine epsilon and the smallest floating point number are different things.

From the Python docs:

epsilon - difference between 1 and the least value greater than 1 that is representable as a float

min - minimum positive normalized float

- #7

Mark44

Mentor

- 34,010

- 5,660

That's really not that surprising. The smallest positive number that you can add to 1, and still get 1, is machine epsilon, which isOh that makes sense. Now what I even more puzzling is that I'm supposed to find a min floating point such that, it plus 1 should not return 1. Interestingly, the output I am getting when adding min float and 1 is 1.

- #8

pbuk

Science Advisor

Gold Member

- 1,634

- 549

Why are we dealing with homework in this forum?... I'm supposed to find a min floating point...

- #9

Mark44

Mentor

- 34,010

- 5,660

Good point.Why are we dealing with homework in this forum?

@BubblesAreUs, this should have been posted in the Homework & Coursework section, under Engineering & Computer Science. For future posts of this nature, please put them in that forum section.

- Last Post

- Replies
- 18

- Views
- 5K

- Replies
- 7

- Views
- 976

- Replies
- 1

- Views
- 2K

- Last Post

- Replies
- 8

- Views
- 3K

- Replies
- 2

- Views
- 1K

- Last Post

- Replies
- 5

- Views
- 11K

- Last Post

- Replies
- 8

- Views
- 4K

- Replies
- 6

- Views
- 792

- Last Post

- Replies
- 5

- Views
- 832

- Last Post

- Replies
- 2

- Views
- 3K