Re: Significant digits in a float?

2014-05-08 Thread Adam Funk
On 2014-05-02, Dennis Lee Bieber wrote: On Thu, 01 May 2014 21:55:20 +0100, Adam Funk a24...@ducksburg.com declaimed the following: On 2014-05-01, Dennis Lee Bieber wrote: Math teacher was selling them in my 10th grade... Actually I already owned a Faber-Castell 57/22 Business ruler

Re: Significant digits in a float?

2014-05-06 Thread Mark H Harris
On 5/1/14 9:06 PM, Dennis Lee Bieber wrote: The N4-ES and the N4-T (mine) are essentially the same rule. The N4-ES on the site is yellow (mine is white) and the site rule indicates Picket Eckel Inc. (that's where the E comes from) Also the the ES states Chicage Ill USA where the T states Made

Re: Significant digits in a float?

2014-05-06 Thread Mark H Harris
On 5/1/14 8:47 PM, Dennis Lee Bieber wrote: On Wed, 30 Apr 2014 22:54:21 -0500, Mark H Harris harrismh...@gmail.com declaimed the following: My high school '74 was the last class to learn the slide-rule using the Sterling (we paid a deposit to use the school's). Since

Re: Significant digits in a float?

2014-05-06 Thread alister
On Tue, 06 May 2014 09:51:25 -0500, Mark H Harris wrote: On 5/1/14 9:06 PM, Dennis Lee Bieber wrote: The N4-ES and the N4-T (mine) are essentially the same rule. The N4-ES on the site is yellow (mine is white) and the site rule indicates Picket Eckel Inc. (that's where the E comes from)

Re: Significant digits in a float?

2014-05-06 Thread Joel Goldstick
HP 35. $350 in 1973 or 4. Still have it somewhere. Tom yay! On May 6, 2014 11:20 AM, alister alister.nospam.w...@ntlworld.com wrote: On Tue, 06 May 2014 09:51:25 -0500, Mark H Harris wrote: On 5/1/14 9:06 PM, Dennis Lee Bieber wrote: The N4-ES and the N4-T (mine) are essentially the same

[OT] Silde rules [was Re: Significant digits in a float?]

2014-05-06 Thread Steven D'Aprano
On Tue, 06 May 2014 09:59:22 -0500, Mark H Harris wrote: [...] I used my rule well into college; the first calculator I owned was the Rockwell 63R --- The Big green numbers, and the little rubber feet! Guys, heaven knows I'm guilty of the occasional off-topic post myself, and I'm not

Re: Significant digits in a float?

2014-05-06 Thread Mark H Harris
On 5/1/14 10:53 AM, William Ray Wing wrote: I’m surprised no one has jumped in to defend/tout the Dietzgen slide rules (which I always thought were the ultimate). Mine (their Vector Log Log) is one of their Microglide series that had teflon rails inserted in the body and is still totally

Re: Off-topic circumnavigating the earth in a mile or less [was Re: Significant digits in a float?]

2014-05-01 Thread Gregory Ewing
Terry Reedy wrote: For the most part, there are no bears within a mile of the North Pole either. they are rare north of 88° (ie, 140 miles from pole). https://en.wikipedia.org/wiki/Polar_bears They mostly hunt in or near open water, near the coastlines. The way things are going, the coastline

Re: Off-topic circumnavigating the earth in a mile or less [was Re: Significant digits in a float?]

2014-05-01 Thread Vlastimil Brom
2014-05-01 3:57 GMT+02:00 Chris Angelico ros...@gmail.com: On Thu, May 1, 2014 at 9:46 AM, Ian Kelly ian.g.ke...@gmail.com wrote: It also works if your starting point is (precisely) the north pole. I believe that's the canonical answer to the riddle, since there are no bears in Antarctica.

Re: Significant digits in a float?

2014-05-01 Thread Roy Smith
In article ljsghc$65b$1...@speranza.aioe.org, Mark H Harris harrismh...@gmail.com wrote: Absolutely, snort. I still have my KE (Keuffel Esser Co. N.Y.); made of wood... (when ships were wood, and men were steel, and sheep ran scared) ... to get to the S L T scales I have to pull the

Re: Significant digits in a float?

2014-05-01 Thread emile
On 04/30/2014 11:21 AM, Grant Edwards wrote: On 2014-04-29, emile em...@fenx.com wrote: On 04/29/2014 01:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where he's back at his tent. What color is the bear? ;-) From how

Re: Significant digits in a float?

2014-05-01 Thread alister
On Thu, 01 May 2014 09:34:35 -0700, emile wrote: On 04/30/2014 11:21 AM, Grant Edwards wrote: On 2014-04-29, emile em...@fenx.com wrote: On 04/29/2014 01:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where he's back at

Re: Significant digits in a float?

2014-05-01 Thread William Ray Wing
On May 1, 2014, at 12:16 AM, Mark H Harris harrismh...@gmail.com wrote: On 4/30/14 10:56 PM, Paul Rubin wrote: There is a nice Javascript simulation of the N4-ES here: http://www.antiquark.com/sliderule/sim/n4es/virtual-n4es.html Thank you! The N4-ES and the N4-T (mine) are

Re: Significant digits in a float?

2014-05-01 Thread Larry Hudson
On 05/01/2014 05:56 AM, Roy Smith wrote: In article ljsghc$65b$1...@speranza.aioe.org, Mark H Harris harrismh...@gmail.com wrote: Absolutely, snort. I still have my KE (Keuffel Esser Co. N.Y.); made of wood... (when ships were wood, and men were steel, and sheep ran scared) ... to get

Re: Significant digits in a float?

2014-05-01 Thread Adam Funk
On 2014-05-01, Dennis Lee Bieber wrote: On Tue, 29 Apr 2014 20:42:33 -0400, Roy Smith r...@panix.com declaimed the following: In article mailman.9594.1398818045.18130.python-l...@python.org, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: (one reason slide-rules were acceptable for so long

Re: Significant digits in a float?

2014-05-01 Thread Adam Funk
On 2014-05-01, Larry Hudson wrote: On 05/01/2014 05:56 AM, Roy Smith wrote: For those who have no idea what we're talking about, take a look at http://www.ted.com/talks/clifford_stoll_on_everything. If you just want to see what you do with a slide rule, fast forward to 14:20, but you

Re: Significant digits in a float?

2014-04-30 Thread Gregory Ewing
Chris Angelico wrote: Any point where the mile east takes you an exact number of times around the globe. So, anywhere exactly one mile north of that, which is a number of circles not far from the south pole. True, but there are no bears in Antarctica, so that rules out all the south-pole

Re: Significant digits in a float?

2014-04-30 Thread Chris Angelico
On Wed, Apr 30, 2014 at 6:14 PM, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Chris Angelico wrote: Any point where the mile east takes you an exact number of times around the globe. So, anywhere exactly one mile north of that, which is a number of circles not far from the south pole.

Re: Significant digits in a float?

2014-04-30 Thread alister
On Tue, 29 Apr 2014 15:42:25 -0700, emile wrote: On 04/29/2014 01:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where he's back at his tent. What color is the bear? ;-) From how many locations on Earth can someone

Re: Significant digits in a float?

2014-04-30 Thread Roy Smith
In article mailman.9603.1398833574.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: But I think a better answer is New York City. You start out lost, you go a mile south, a mile east, a mile north, and you are again lost. Only in Queens. --

Re: Significant digits in a float?

2014-04-30 Thread Mark Lawrence
On 30/04/2014 09:14, Gregory Ewing wrote: Chris Angelico wrote: Any point where the mile east takes you an exact number of times around the globe. So, anywhere exactly one mile north of that, which is a number of circles not far from the south pole. True, but there are no bears in

Off-topic circumnavigating the earth in a mile or less [was Re: Significant digits in a float?]

2014-04-30 Thread Ethan Furman
On 04/29/2014 03:51 PM, Chris Angelico wrote: On Wed, Apr 30, 2014 at 8:42 AM, emile em...@fenx.com wrote: On 04/29/2014 01:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where he's back at his tent. What color is the bear?

Re: Off-topic circumnavigating the earth in a mile or less [was Re: Significant digits in a float?]

2014-04-30 Thread Ethan Furman
On 04/30/2014 06:14 AM, Ethan Furman wrote: On 04/29/2014 03:51 PM, Chris Angelico wrote: On Wed, Apr 30, 2014 at 8:42 AM, emile em...@fenx.com wrote: On 04/29/2014 01:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where

Re: Off-topic circumnavigating the earth in a mile or less [was Re: Significant digits in a float?]

2014-04-30 Thread Chris Angelico
On Wed, Apr 30, 2014 at 11:14 PM, Ethan Furman et...@stoneleaf.us wrote: Any point where the mile east takes you an exact number of times around the globe. So, anywhere exactly one mile north of that, which is a number of circles not far from the south pole. It is my contention, completely

Re: Significant digits in a float?

2014-04-30 Thread Grant Edwards
On 2014-04-29, Roy Smith r...@panix.com wrote: What reason do you have to think that something recorded to 14 decimal places was only intended to have been recorded to 4? Because I understand the physical measurement these numbers represent. Sometimes, Steve, you have to assume that when

Re: Significant digits in a float?

2014-04-30 Thread Grant Edwards
On 2014-04-29, Roy Smith r...@panix.com wrote: In article mailman.9575.1398789020.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Tue, Apr 29, 2014 at 11:38 PM, Roy Smith r...@panix.com wrote: I'm trying to intuit, from the values I've been given, which coordinates

Re: Significant digits in a float?

2014-04-30 Thread Grant Edwards
On 2014-04-29, emile em...@fenx.com wrote: On 04/29/2014 01:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where he's back at his tent. What color is the bear? ;-) From how many locations on Earth can someone walk one

Re: Off-topic circumnavigating the earth in a mile or less [was Re: Significant digits in a float?]

2014-04-30 Thread Chris Angelico
On Thu, May 1, 2014 at 12:02 AM, Ethan Furman et...@stoneleaf.us wrote: Wow. It's amazing how writing something down, wrongly (I originally had north and south reversed), correcting it, letting some time pass (enough to post the message so one can be properly embarrassed ;), and then rereading

Re: Off-topic circumnavigating the earth in a mile or less [was Re: Significant digits in a float?]

2014-04-30 Thread Ryan Hiebert
On Wed, Apr 30, 2014 at 9:02 AM, Ethan Furman et...@stoneleaf.us wrote: On 04/30/2014 06:14 AM, Ethan Furman wrote: On 04/29/2014 03:51 PM, Chris Angelico wrote: On Wed, Apr 30, 2014 at 8:42 AM, emile em...@fenx.com wrote: On 04/29/2014 01:16 PM, Adam Funk wrote: A man pitches his tent,

Re: Off-topic circumnavigating the earth in a mile or less [was Re: Significant digits in a float?]

2014-04-30 Thread Ian Kelly
On Wed, Apr 30, 2014 at 7:14 AM, Ethan Furman et...@stoneleaf.us wrote: On 04/29/2014 03:51 PM, Chris Angelico wrote: On Wed, Apr 30, 2014 at 8:42 AM, emile em...@fenx.com wrote: On 04/29/2014 01:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a

Re: Off-topic circumnavigating the earth in a mile or less [was Re: Significant digits in a float?]

2014-04-30 Thread Terry Reedy
On 4/30/2014 7:46 PM, Ian Kelly wrote: It also works if your starting point is (precisely) the north pole. I believe that's the canonical answer to the riddle, since there are no bears in Antarctica. For the most part, there are no bears within a mile of the North Pole either. they are rare

Re: Off-topic circumnavigating the earth in a mile or less [was Re: Significant digits in a float?]

2014-04-30 Thread Chris Angelico
On Thu, May 1, 2014 at 9:46 AM, Ian Kelly ian.g.ke...@gmail.com wrote: It also works if your starting point is (precisely) the north pole. I believe that's the canonical answer to the riddle, since there are no bears in Antarctica. Yeah but that's way too obvious! Anyway, it's rather hard to

Re: Significant digits in a float?

2014-04-30 Thread Mark H Harris
On 4/30/14 7:02 PM, Dennis Lee Bieber wrote: Sterling? Snort. KE was the way to go. Absolutely, snort. I still have my KE (Keuffel Esser Co. N.Y.); made of wood... (when ships were wood, and men were steel, and sheep ran scared) ... to get to the S L T scales I have to pull the slide

Re: Significant digits in a float?

2014-04-30 Thread Paul Rubin
Mark H Harris harrismh...@gmail.com writes: I received my Pickett Model N4-T Vector-Type Log Log Dual-Base Speed Rule as a graduation | birthday gift... There is a nice Javascript simulation of the N4-ES here: http://www.antiquark.com/sliderule/sim/n4es/virtual-n4es.html Some other models

Re: Significant digits in a float?

2014-04-30 Thread Mark H Harris
On 4/30/14 10:56 PM, Paul Rubin wrote: There is a nice Javascript simulation of the N4-ES here: http://www.antiquark.com/sliderule/sim/n4es/virtual-n4es.html Thank you! The N4-ES and the N4-T (mine) are essentially the same rule. The N4-ES on the site is yellow (mine is white) and the

Re: Significant digits in a float?

2014-04-29 Thread Roy Smith
In article 535f0f9f$0$29965$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 28 Apr 2014 12:00:23 -0400, Roy Smith wrote: [...] Fundamentally, these numbers have between 0 and 4 decimal digits of precision, I'm surprised that you

Re: Significant digits in a float?

2014-04-29 Thread Vlastimil Brom
2014-04-28 18:00 GMT+02:00 Roy Smith r...@panix.com: I'm using Python 2.7 I have a bunch of floating point values. For example, here's a few (printed as reprs): 38.0 41.2586 40.752801 49.25 33.7951994 36.8371996 34.1489 45.5 Fundamentally, these numbers

Re: Significant digits in a float?

2014-04-29 Thread Chris Angelico
On Tue, Apr 29, 2014 at 11:38 PM, Roy Smith r...@panix.com wrote: I'm trying to intuit, from the values I've been given, which coordinates are likely to be accurate to within a few miles. I'm willing to accept a few false negatives. If the number is float(38), I'm willing to accept that it

Re: Significant digits in a float?

2014-04-29 Thread Ned Batchelder
On 4/29/14 12:30 PM, Chris Angelico wrote: On Tue, Apr 29, 2014 at 11:38 PM, Roy Smith r...@panix.com wrote: I'm trying to intuit, from the values I've been given, which coordinates are likely to be accurate to within a few miles. I'm willing to accept a few false negatives. If the number is

Re: Significant digits in a float?

2014-04-29 Thread Chris Angelico
On Wed, Apr 30, 2014 at 2:47 AM, Ned Batchelder n...@nedbatchelder.com wrote: Reminds me of the story that the first survey of Mt. Everest resulted in a height of exactly 29,000 feet, but to avoid the appearance of an estimate, they reported it as 29,002: http://www.jstor.org/stable/2684102

Re: Significant digits in a float?

2014-04-29 Thread Adam Funk
On 2014-04-29, Roy Smith wrote: Another possibility is that they're latitude/longitude coordinates, some of which are given to the whole degree, some of which are given to greater precision, all the way down to the ten-thousandth of a degree. That makes sense. 1° of longitude is about 111

Re: Significant digits in a float?

2014-04-29 Thread Mark H Harris
On 4/29/14 3:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where he's back at his tent. What color is the bear? ;-) Who manufactured the tent? marcus -- https://mail.python.org/mailman/listinfo/python-list

Re: Significant digits in a float?

2014-04-29 Thread Ryan Hiebert
On Tue, Apr 29, 2014 at 3:16 PM, Adam Funk a24...@ducksburg.com wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where he's back at his tent. What color is the bear? ;-) Skin or Fur? -- https://mail.python.org/mailman/listinfo/python-list

Re: Significant digits in a float?

2014-04-29 Thread Chris Angelico
On Wed, Apr 30, 2014 at 6:39 AM, Mark H Harris harrismh...@gmail.com wrote: On 4/29/14 3:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where he's back at his tent. What color is the bear? ;-) Who manufactured the tent?

Re: Significant digits in a float?

2014-04-29 Thread Gregory Ewing
Ned Batchelder wrote: Reminds me of the story that the first survey of Mt. Everest resulted in a height of exactly 29,000 feet, but to avoid the appearance of an estimate, they reported it as 29,002: http://www.jstor.org/stable/2684102 They could have said it was 29.000 kilofeet. -- Greg --

Re: Significant digits in a float?

2014-04-29 Thread emile
On 04/29/2014 01:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where he's back at his tent. What color is the bear? ;-) From how many locations on Earth can someone walk one mile south, one mile east, and one mile north

Re: Significant digits in a float?

2014-04-29 Thread Chris Angelico
On Wed, Apr 30, 2014 at 8:42 AM, emile em...@fenx.com wrote: On 04/29/2014 01:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where he's back at his tent. What color is the bear? ;-) From how many locations on Earth can

Re: Significant digits in a float?

2014-04-29 Thread Mark Lawrence
On 29/04/2014 23:42, emile wrote: On 04/29/2014 01:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where he's back at his tent. What color is the bear? ;-) From how many locations on Earth can someone walk one mile south,

Re: Significant digits in a float?

2014-04-29 Thread Roy Smith
In article mailman.9575.1398789020.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Tue, Apr 29, 2014 at 11:38 PM, Roy Smith r...@panix.com wrote: I'm trying to intuit, from the values I've been given, which coordinates are likely to be accurate to within a few miles.

Re: Significant digits in a float?

2014-04-29 Thread Chris Angelico
On Wed, Apr 30, 2014 at 9:53 AM, Roy Smith r...@panix.com wrote: In article mailman.9575.1398789020.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Tue, Apr 29, 2014 at 11:38 PM, Roy Smith r...@panix.com wrote: I'm trying to intuit, from the values I've been given,

Re: Significant digits in a float?

2014-04-29 Thread Ben Finney
Roy Smith r...@panix.com writes: In article mailman.9575.1398789020.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: You have one chance in ten, repeatably, of losing a digit. That is, roughly 10% of your four-decimal figures will appear to be three-decimal, and 1%

Re: Significant digits in a float?

2014-04-29 Thread Chris Angelico
On Wed, Apr 30, 2014 at 10:13 AM, Ben Finney b...@benfinney.id.au wrote: The problem is you won't know *which* 90% is accurate, and which 10% is inaccurate. This is very different from the glass, where it's evident which part is good. So, I can't see that you have any choice but to say that

Re: Significant digits in a float?

2014-04-29 Thread Ben Finney
Ben Finney b...@benfinney.id.au writes: The problem is you won't know *which* 90% is accurate, and which 10% is inaccurate. This is very different from the glass, where it's evident which part is good. Hmm. Re-reading the suggestion, I see that it is fairly predictable which estimates of

Re: Significant digits in a float?

2014-04-29 Thread Roy Smith
In article mailman.9594.1398818045.18130.python-l...@python.org, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: in a physics or chemistry class the recommended result is 1.1 * 2.2 = 2.4 More than recommended. In my physics class, if you put down more significant digits than the input

Re: Significant digits in a float?

2014-04-29 Thread Chris Angelico
On Wed, Apr 30, 2014 at 10:37 AM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Wed, 30 Apr 2014 08:51:32 +1000, Chris Angelico ros...@gmail.com declaimed the following: Any point where the mile east takes you an exact number of times around the globe. So, anywhere exactly one mile north

Re: Significant digits in a float?

2014-04-29 Thread Roy Smith
In article 8td53bxud5@news.ducksburg.com, Adam Funk a24...@ducksburg.com wrote: On 2014-04-29, Roy Smith wrote: Another possibility is that they're latitude/longitude coordinates, some of which are given to the whole degree, some of which are given to greater precision, all the

Re: Significant digits in a float?

2014-04-29 Thread Roy Smith
In article mailman.9596.1398818760.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Wed, Apr 30, 2014 at 10:37 AM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Wed, 30 Apr 2014 08:51:32 +1000, Chris Angelico ros...@gmail.com declaimed the following: Any

Re: Significant digits in a float?

2014-04-29 Thread Steven D'Aprano
On Tue, 29 Apr 2014 09:38:33 -0400, Roy Smith wrote: What reason do you have to think that something recorded to 14 decimal places was only intended to have been recorded to 4? Because I understand the physical measurement these numbers represent. Sometimes, Steve, you have to assume that

Re: Significant digits in a float?

2014-04-29 Thread Ethan Furman
On 04/29/2014 03:51 PM, Chris Angelico wrote: On Wed, Apr 30, 2014 at 8:42 AM, emile em...@fenx.com wrote: On 04/29/2014 01:16 PM, Adam Funk wrote: A man pitches his tent, walks 1 km south, walks 1 km east, kills a bear, walks 1 km north, where he's back at his tent. What color is the bear?

Re: Significant digits in a float?

2014-04-29 Thread Steven D'Aprano
On Tue, 29 Apr 2014 19:31:31 -0700, Ethan Furman wrote: Perhaps my geography is rusty, but I was under the impression that one cannot travel south if one is at the South Pole (axial, not magnetic). Possibly with a rocket aimed straight up. -- Steven D'Aprano

Re: Significant digits in a float?

2014-04-29 Thread Roy Smith
In article 5360672e$0$29965$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Tue, 29 Apr 2014 19:31:31 -0700, Ethan Furman wrote: Perhaps my geography is rusty, but I was under the impression that one cannot travel south if one is at the

Re: Significant digits in a float?

2014-04-29 Thread Chris Angelico
On Wed, Apr 30, 2014 at 12:31 PM, Ethan Furman et...@stoneleaf.us wrote: On 04/29/2014 03:51 PM, Chris Angelico wrote: Any point where the mile east takes you an exact number of times around the globe. So, anywhere exactly one mile north of that, which is a number of circles not far from the

Re: Significant digits in a float?

2014-04-29 Thread Chris Angelico
On Wed, Apr 30, 2014 at 1:30 PM, Roy Smith r...@panix.com wrote: In article 5360672e$0$29965$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Tue, 29 Apr 2014 19:31:31 -0700, Ethan Furman wrote: Perhaps my geography is rusty, but I was

Significant digits in a float?

2014-04-28 Thread Roy Smith
I'm using Python 2.7 I have a bunch of floating point values. For example, here's a few (printed as reprs): 38.0 41.2586 40.752801 49.25 33.7951994 36.8371996 34.1489 45.5 Fundamentally, these numbers have between 0 and 4 decimal digits of precision, and I want to be

Re: Significant digits in a float?

2014-04-28 Thread Ned Batchelder
On 4/28/14 12:00 PM, Roy Smith wrote: Fundamentally, these numbers have between 0 and 4 decimal digits of precision, and I want to be able to intuit how many each has, ignoring the obvious floating point roundoff problems. Thus, I want to map: 38.0 == 0 41.2586 == 4 40.752801 == 4

Re: Significant digits in a float?

2014-04-28 Thread Chris Angelico
On Tue, Apr 29, 2014 at 2:00 AM, Roy Smith r...@panix.com wrote: I have a bunch of floating point values. For example, here's a few (printed as reprs): 38.0 41.2586 40.752801 49.25 33.7951994 36.8371996 34.1489 45.5 Fundamentally, these numbers have between 0

Re: Significant digits in a float?

2014-04-28 Thread Roy Smith
On Monday, April 28, 2014 12:28:59 PM UTC-4, Chris Angelico wrote: Terminology question: Why do you count only what's after the decimal point? I would describe these as having between 2 and 6 significant figures. Will they always have two digits before the decimal, or does your precision

Re: Significant digits in a float?

2014-04-28 Thread Roy Smith
On Monday, April 28, 2014 12:07:14 PM UTC-4, Ned Batchelder wrote: On 4/28/14 12:00 PM, Roy Smith wrote: 38.0 == 0 [...] Is there any clean way to do that? The best I've come up with so far is to str() them and parse the remaining string to see how many digits it put after the decimal

Re: Significant digits in a float?

2014-04-28 Thread Ned Batchelder
On 4/28/14 2:39 PM, Roy Smith wrote: On Monday, April 28, 2014 12:07:14 PM UTC-4, Ned Batchelder wrote: On 4/28/14 12:00 PM, Roy Smith wrote: 38.0 == 0 [...] Is there any clean way to do that? The best I've come up with so far is to str() them and parse the remaining string to see how many

Re: Significant digits in a float?

2014-04-28 Thread Steven D'Aprano
On Mon, 28 Apr 2014 12:00:23 -0400, Roy Smith wrote: [...] Fundamentally, these numbers have between 0 and 4 decimal digits of precision, I'm surprised that you have a source of data with variable precision, especially one that varies by a factor of TEN THOUSAND. The difference between 0

Re: Significant digits in a float?

2014-04-28 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: By the way, you contradict yourself here. Earlier, you described 38.0 as having zero decimal places (which is wrong). Here you describe it as having one, which is correct, and then in a later post you describe it as having zero

Re: Significant digits in a float?

2014-04-28 Thread Steven D'Aprano
On Tue, 29 Apr 2014 13:23:07 +1000, Ben Finney wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: By the way, you contradict yourself here. Earlier, you described 38.0 as having zero decimal places (which is wrong). Here you describe it as having one, which is correct, and