Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-22 Thread Ben Bacarisse
Chris Kaynor writes: > On Thu, Jul 21, 2016 at 4:54 PM, Ben Bacarisse wrote: > >> Steven D'Aprano writes: >> >> > Or you might be using a language like Javascript, which intentionally has >> > only floats for numbers. That's

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-21 Thread Chris Kaynor
On Thu, Jul 21, 2016 at 4:54 PM, Ben Bacarisse wrote: > Steven D'Aprano writes: > > > Or you might be using a language like Javascript, which intentionally has > > only floats for numbers. That's okay, you can still perform exact integer > >

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-21 Thread Ben Bacarisse
Steven D'Aprano writes: > Or you might be using a language like Javascript, which intentionally has > only floats for numbers. That's okay, you can still perform exact integer > arithmetic, so long as you stay within the bounds of ±2**16. Small point: it's 2**52. -- Ben.

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-21 Thread Steven D'Aprano
On Thu, 21 Jul 2016 11:14 pm, Rustom Mody wrote: > On Thursday, July 21, 2016 at 12:04:35 PM UTC+5:30, Steven D'Aprano wrote: >> On Thursday 21 July 2016 15:28, Rustom Mody wrote: >> > BTW APL whose main domain of application is scientific chooses to >> > enshrine this —equality is ε-neighborhood

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-21 Thread Rustom Mody
On Thursday, July 21, 2016 at 12:04:35 PM UTC+5:30, Steven D'Aprano wrote: > On Thursday 21 July 2016 15:28, Rustom Mody wrote: > > BTW APL whose main domain of application is scientific chooses to enshrine > > this —equality is ε-neighborhood checking not exact equality checking — into > > its

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-21 Thread Marko Rauhamaa
Chris Angelico : > On Thu, Jul 21, 2016 at 5:52 PM, Marko Rauhamaa wrote: >> A couple of related anecdotes involving integer errors. >> >> 1. I worked on a (video) product that had to execute a piece of code >>every 7 µs or so. A key requirement was that

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-21 Thread Chris Angelico
On Thu, Jul 21, 2016 at 5:52 PM, Marko Rauhamaa wrote: > A couple of related anecdotes involving integer errors. > > 1. I worked on a (video) product that had to execute a piece of code >every 7 µs or so. A key requirement was that the beat must not drift >far apart from

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-21 Thread Marko Rauhamaa
Rustom Mody : > The field of numerical analysis came into existence only because this > fact multiplied by the fact that computers do their (inaccurate ≠ > inexact) computations billions of times faster than we do makes > significance a very significant problem! A couple of

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-21 Thread Steven D'Aprano
On Thursday 21 July 2016 15:28, Rustom Mody wrote: > On Wednesday, July 20, 2016 at 11:13:05 AM UTC+5:30, Steven D'Aprano wrote: >> On Tuesday 19 July 2016 14:58, Rustom Mody wrote: >> >> > So I again ask: You say «"Never compare floats for equality" is a >> > pernicious myth» >> >> It is the

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-20 Thread Rustom Mody
On Thursday, July 21, 2016 at 11:05:28 AM UTC+5:30, Chris Angelico wrote: > On Thu, Jul 21, 2016 at 3:28 PM, Rustom Mody wrote: > > ε is spelt ⎕ct (Comparison Tolerance) > > And of course == is spelt = > > spelt is spelled spelled. Unless, of course, you mean the wheat variety. Love it! Though

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-20 Thread Rustom Mody
On Wednesday, July 20, 2016 at 8:29:25 PM UTC+5:30, Marko Rauhamaa wrote: > Chris Angelico : > > > On Wed, Jul 20, 2016 at 11:54 PM, Marko Rauhamaa wrote: > >> 2. Floating-point numbers are *imperfect approximations* of real > >> numbers. Even when real numbers are derived exactly, > >>

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-20 Thread Chris Angelico
On Thu, Jul 21, 2016 at 3:28 PM, Rustom Mody wrote: > ε is spelt ⎕ct (Comparison Tolerance) > And of course == is spelt = spelt is spelled spelled. Unless, of course, you mean the wheat variety. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-20 Thread Rustom Mody
On Wednesday, July 20, 2016 at 11:13:05 AM UTC+5:30, Steven D'Aprano wrote: > On Tuesday 19 July 2016 14:58, Rustom Mody wrote: > > > So I again ask: You say «"Never compare floats for equality" is a pernicious > > myth» > > It is the word *never* which makes it superstition. If people said

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-20 Thread Steven D'Aprano
On Wed, 20 Jul 2016 11:24 pm, alister wrote: > One of my biggest questions since the Brexit vote is can we g back to > using imperial weights & measures (please). I suppose you might as well -- there's no more empire, no more jobs or houses, and once the financial traders leave London there'll

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-20 Thread Gregory Ewing
Random832 wrote: Well, your amp hours will be shittier with a lower voltage. Define "shittier". An incandescent flashlight (which consumes less power at lower voltage) will last longer, but won't be as bright. If it's still acceptably bright, that's not worse. I think the point is that the

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-20 Thread Marko Rauhamaa
Chris Angelico : > On Wed, Jul 20, 2016 at 11:54 PM, Marko Rauhamaa wrote: >> 2. Floating-point numbers are *imperfect approximations* of real >> numbers. Even when real numbers are derived exactly, >> floating-point operations may introduce "lossy

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-20 Thread Chris Angelico
On Wed, Jul 20, 2016 at 11:54 PM, Marko Rauhamaa wrote: > 2. Floating-point numbers are *imperfect approximations* of real > numbers. Even when real numbers are derived exactly, floating-point > operations may introduce "lossy compression artifacts" that have to >

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-20 Thread Random832
On Wed, Jul 20, 2016, at 03:16, Marko Rauhamaa wrote: > Random832 : > > Typically their capacity is labeled in amp-hours. > > Did you really see that labeled on the (nonrechargeable AA) battery? Sorry, I must have imagined that. Anyway, my point was that the reality is

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-20 Thread Marko Rauhamaa
Steven D'Aprano : > I am not a good computer scientist. But Bruce Dawson *is* a good > computer scientist: > > https://randomascii.wordpress.com/2014/01/27/theres-only-four-billion-f > loatsso-test-them-all/ > > Quote: > > Conventional wisdom says that you should never

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-20 Thread alister
On Wed, 20 Jul 2016 02:09:58 +0300, Marko Rauhamaa wrote: > Ian Kelly : > >> Ah, the machinations that users of imperial units have to endure. > > Europeans often mistakenly believe that Americans haven't yet adopted > the SI units. They have: > > - the length of a ski

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-20 Thread Steven D'Aprano
On Wed, 20 Jul 2016 05:09 pm, Antoon Pardon wrote: > Op 20-07-16 om 07:42 schreef Steven D'Aprano: >> Floating point maths is hard, thinking carefully about what you are doing >> and whether it is appropriate to use == or a fuzzy almost-equal >> comparison, or if equality is the right way at all.

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-20 Thread Marko Rauhamaa
Antoon Pardon : > But why perforem integer arithmetics in floats, Conceptual and practical simplificity. > isn't that a waste of time too? Probably not, especially compared with the overhead of boxing. Marko --

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-20 Thread Marko Rauhamaa
Random832 : > On Tue, Jul 19, 2016, at 18:17, Marko Rauhamaa wrote: >> I'd love it if batteries were priced per joule, or even per >> kilowatt-hour. > > Typically their capacity is labeled in amp-hours. Did you really see that labeled on the (nonrechargeable AA) battery?

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-20 Thread Antoon Pardon
Op 20-07-16 om 07:42 schreef Steven D'Aprano: > Floating point maths is hard, thinking carefully about what you are doing and > whether it is appropriate to use == or a fuzzy almost-equal comparison, or if > equality is the right way at all. > > "But thinking is hard, can't you just tell me the

Re: Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-20 Thread Chris Angelico
On Wed, Jul 20, 2016 at 3:42 PM, Steven D'Aprano wrote: > Arithmetic on integer-values (e.g. 1.0) is always exact, up to a limit of > either 2**53 or approximately 1e53, I forget which. (That's why most > Javascript > programmers fail to notice that they

Floating point equality [was Re: What exactly is "exact" (was Clean Singleton Docstrings)]

2016-07-19 Thread Steven D'Aprano
On Tuesday 19 July 2016 14:58, Rustom Mody wrote: > So I again ask: You say «"Never compare floats for equality" is a pernicious > myth» It is the word *never* which makes it superstition. If people said "Take care with using == for floats, its often not what you want" I would have no argument

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-19 Thread Gene Heskett
On Tuesday 19 July 2016 18:27:10 Ian Kelly wrote: > On Tue, Jul 19, 2016 at 2:35 PM, Gene Heskett wrote: > > And I am not familiar with this foot-poundals per second that you > > question about, but just from the wording I'd say it is a fifty > > dollar way to say

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-19 Thread Random832
On Tue, Jul 19, 2016, at 18:17, Marko Rauhamaa wrote: > I'd love it if batteries were priced per joule, or even per > kilowatt-hour. Typically their capacity is labeled in amp-hours. You have to know your devices to know if the voltage difference between different battery types (Which ranges from

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-19 Thread Lawrence D’Oliveiro
On Wednesday, July 20, 2016 at 10:28:04 AM UTC+12, Ian wrote: > Ah, the machinations that users of imperial units have to endure. Deep in some people’s hearts, the Mars Climate Orbiter still sails... -- https://mail.python.org/mailman/listinfo/python-list

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-19 Thread Marko Rauhamaa
Gregory Ewing : > Physicists realised that nearly a century ago, and no > longer use the idea of a velocity-dependent mass. Roche states that about 60% of modern authors just use rest mass and avoid relativistic mass.

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-19 Thread Marko Rauhamaa
Ian Kelly : > Ah, the machinations that users of imperial units have to endure. Europeans often mistakenly believe that Americans haven't yet adopted the SI units. They have: - the length of a ski is measured in centimeters - the width of film and the diameter of a gun

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-19 Thread Gregory Ewing
Gene Heskett wrote: The theory of relativity says that the faster you are going, the more massive you become. It doesn't, really. The equations only seem to say that if you insist on keeping the Newtonian definitions of momentum and kinetic energy in the context of relativity, which is a silly

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-19 Thread Ian Kelly
On Tue, Jul 19, 2016 at 2:35 PM, Gene Heskett wrote: > And I am not familiar with this foot-poundals per second that you > question about, but just from the wording I'd say it is a fifty dollar > way to say horsepower. https://en.wikipedia.org/wiki/Foot-poundal > Which is

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-19 Thread Marko Rauhamaa
Gene Heskett : > On Tuesday 19 July 2016 13:46:37 Lawrence D’Oliveiro wrote: >> What is this “watt” of which you speak? > > A unit of electrical power, simplified to 1 volt at 1 amp = 1 watt > when that currant is passed thru a 1 ohm resistor. But since the > majority of

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-19 Thread Gene Heskett
On Tuesday 19 July 2016 13:46:37 Lawrence D’Oliveiro wrote: > On Wednesday, July 20, 2016 at 12:07:25 AM UTC+12, Gene Heskett wrote: > > This klystron amplifier, a new one of which was north of $125,000 in > > the 1970's when I learned about them, is a long tube, around 5 feet > > long with

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-19 Thread Lawrence D’Oliveiro
On Wednesday, July 20, 2016 at 12:07:25 AM UTC+12, Gene Heskett wrote: > This klystron amplifier, a new one of which was north of $125,000 in the > 1970's when I learned about them, is a long tube, around 5 feet long > with alternating sections of copper tubeing and ceramic insulators >

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-19 Thread Gene Heskett
On Monday 18 July 2016 23:16:32 Steven D'Aprano wrote: > On Tue, 19 Jul 2016 10:36 am, Rustom Mody wrote: > > I recollect — school physics textbook so sorry no link — > > that in the Newton gravitation law > > f = -GMm/r² > > > > there was a discussion about the exponent of r ie 2 > > And that

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Chris Angelico
On Tue, Jul 19, 2016 at 2:58 PM, Rustom Mody wrote: > Analogy: > Mutable default parameters are a source of problem and confusion. > > No A says. One can use them to simulate statics > > No B says No problem as long as you make sure there is no mutation to the > mutable,

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Chris Angelico
On Tue, Jul 19, 2016 at 1:42 PM, Steven D'Aprano wrote: >> And then you get these sorts of functions: >> >> EPSILON = 0.01 # Adjust to control numeric accuracy >> def is_equal(f1, f2, epsilon=EPSILON): >> if abs(f1) > abs(f2): >> f1, f2 = f2, f1 >> return

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Rustom Mody
On Tuesday, July 19, 2016 at 9:12:57 AM UTC+5:30, Steven D'Aprano wrote: > On Mon, 18 Jul 2016 08:15 pm, Chris Angelico wrote: > > > On Mon, Jul 18, 2016 at 8:00 PM, Marko Rauhamaa wrote: > >> Python programmers (among others) frequently run into issues with > >> surprising results in

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Steven D'Aprano
On Mon, 18 Jul 2016 08:15 pm, Chris Angelico wrote: > On Mon, Jul 18, 2016 at 8:00 PM, Marko Rauhamaa wrote: >> Python programmers (among others) frequently run into issues with >> surprising results in floating-point arithmetics. For better or worse, >> Scheme has tried to

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Rustom Mody
On Tuesday, July 19, 2016 at 8:46:44 AM UTC+5:30, Steven D'Aprano wrote: > On Tue, 19 Jul 2016 10:36 am, Rustom Mody wrote: > > > I recollect — school physics textbook so sorry no link — > > that in the Newton gravitation law > > f = -GMm/r² > > > > there was a discussion about the exponent of r

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Steven D'Aprano
On Mon, 18 Jul 2016 11:25 pm, Random832 wrote: > On Mon, Jul 18, 2016, at 00:46, Ben Finney wrote: >> What is “those”? The measurement is imprecise, the observations are >> inexact. >> >> It makes no sense to say that a number is inexact. Exactness is not a >> property of a number. > > There's

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Steven D'Aprano
On Tue, 19 Jul 2016 10:36 am, Rustom Mody wrote: > I recollect — school physics textbook so sorry no link — > that in the Newton gravitation law > f = -GMm/r² > > there was a discussion about the exponent of r ie 2 > And that to some 6 decimal places it had been verified that it was > actually

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Steven D'Aprano
On Tue, 19 Jul 2016 01:25 am, Ian Kelly wrote: > On Mon, Jul 18, 2016 at 3:29 AM, Steven D'Aprano > wrote: >> On Monday 18 July 2016 14:16, Rustom Mody wrote: >>> In short one could think of inexact and exact — in scheme's intended >>> semantics — as better

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Rustom Mody
On Tuesday, July 19, 2016 at 12:28:36 AM UTC+5:30, Marko Rauhamaa wrote: > Ian Kelly : > > > Okay, so how is that wavelength defined? > > > > If you needed to mark a meter stick, and all you had was the > > definition of c and the second, how would you do it without measuring > > anything? > > I

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Ben Finney
Random832 writes: > On Mon, Jul 18, 2016, at 00:46, Ben Finney wrote: > > What is “those”? The measurement is imprecise, the observations are > > inexact. > > > > It makes no sense to say that a number is inexact. Exactness is not > > a property of a number. > > There's

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Marko Rauhamaa
Ian Kelly : > Okay, so how is that wavelength defined? > > If you needed to mark a meter stick, and all you had was the > definition of c and the second, how would you do it without measuring > anything? I wouldn't be measuring a meter stick. To measure, say, the height of

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Ian Kelly
On Mon, Jul 18, 2016 at 9:55 AM, Marko Rauhamaa wrote: > Marko Rauhamaa : > >> Ian Kelly : >>> Off-topic, c being a fundamental constant is actually in the latter >>> category. Its *exact* value is 299792458 m/s. >>> >>> The length of the

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Marko Rauhamaa
Marko Rauhamaa : > Ian Kelly : >> Off-topic, c being a fundamental constant is actually in the latter >> category. Its *exact* value is 299792458 m/s. >> >> The length of the meter, on the other hand, is defined as the distance >> traveled by light in a

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Marko Rauhamaa
Ian Kelly : > Off-topic, c being a fundamental constant is actually in the latter > category. Its *exact* value is 299792458 m/s. > > The length of the meter, on the other hand, is defined as the distance > traveled by light in a vacuum in 1/299792458 seconds and is subject

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Ian Kelly
On Mon, Jul 18, 2016 at 3:29 AM, Steven D'Aprano wrote: > On Monday 18 July 2016 14:16, Rustom Mody wrote: >> In short one could think of inexact and exact — in scheme's intended >> semantics — as better called scientific (or science-ic) and mathematic >>

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Random832
On Mon, Jul 18, 2016, at 01:37, Rustom Mody wrote: > The INTENTION is that in addition to capturing the usual number tower > ℕ ⊂ ℤ ⊂ ℝ (or parts therefore) Well, ℚ. You hardly ever see representations of numbers that are in ℝ-ℚ. > scheme also captures ORTHOGONALLY (word in the docs) the

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Random832
On Mon, Jul 18, 2016, at 00:46, Ben Finney wrote: > What is “those”? The measurement is imprecise, the observations are > inexact. > > It makes no sense to say that a number is inexact. Exactness is not a > property of a number. There's no reason it shouldn't be a property of an object of a

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Peter Otten
Marko Rauhamaa wrote: > Chris Angelico : >> you don't need an infinite amount of paper, except that they work with >> binary rather than decimal, so people think "0.1 + 0.2 ought to be >> exactly 0.3, why isn't it??", and blame floats. > > Oh, if we only had eight fingers on

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Marko Rauhamaa
Chris Angelico : > you don't need an infinite amount of paper, except that they work with > binary rather than decimal, so people think "0.1 + 0.2 ought to be > exactly 0.3, why isn't it??", and blame floats. Oh, if we only had eight fingers on our hand... Scheme, though

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Chris Angelico
On Mon, Jul 18, 2016 at 8:24 PM, Rustom Mody wrote: > I dont know what point you are trying to make > Here is behavior. Should one use == ?? > > Python 2.7.11+ (default, Apr 17 2016, 14:00:29) > [GCC 5.3.1 20160413] on linux2 > Type "help", "copyright", "credits" or

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Rustom Mody
On Monday, July 18, 2016 at 3:45:26 PM UTC+5:30, Chris Angelico wrote: > On Mon, Jul 18, 2016 at 8:00 PM, Marko Rauhamaa wrote: > > Python programmers (among others) frequently run into issues with > > surprising results in floating-point arithmetics. For better or worse, > > Scheme has tried to

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Chris Angelico
On Mon, Jul 18, 2016 at 8:00 PM, Marko Rauhamaa wrote: > Python programmers (among others) frequently run into issues with > surprising results in floating-point arithmetics. For better or worse, > Scheme has tried to abstract the concept. You don't need to explain the > ideas

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Rustom Mody
On Monday, July 18, 2016 at 2:59:56 PM UTC+5:30, Steven D'Aprano wrote: > On Monday 18 July 2016 14:16, Rustom Mody wrote: > > AIUI… > > There are two almost completely unrelated notions of exact > > > > 1. ⅓ in decimal cannot be exactly represented though 0.3 0.33 etc are > > approximations. >

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Marko Rauhamaa
Steven D'Aprano : > I think one could better think of Scheme's semantics as a > poorly-thought out hybrid between traditional numerics and a vague > approximation to interval arithmetic. Python programmers (among others) frequently run into issues with

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Steven D'Aprano
On Monday 18 July 2016 14:16, Rustom Mody wrote: > On Saturday, July 16, 2016 at 3:16:48 PM UTC+5:30, Steven D'Aprano wrote: >> But that's *wrong*. Numbers are never inexact. (You can have interval >> arithmetic using "fuzzy numbers", but they're ALWAYS inexact.) It is >> calculations which are

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-18 Thread Marko Rauhamaa
Chris Angelico : > Ah. Okay. So in theory, you could have exact float literals and > inexact integer literals, if you tag them in some way: > > 300 ; Exactly 300 > 300! ; Inexact - roughly 300 > 3.0 ; Exactly three > 3.0! ; Roughly three and zero tenths In Scheme:

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-17 Thread Chris Angelico
On Mon, Jul 18, 2016 at 3:37 PM, Rustom Mody wrote: > On Monday, July 18, 2016 at 10:06:11 AM UTC+5:30, Chris Angelico wrote: >> Why does that mean that 3.0 is inexact? In what way is 3.0 "inexact"? >> It's an exact value representing the integer three. > > [Assuming you

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-17 Thread Rustom Mody
On Monday, July 18, 2016 at 10:06:11 AM UTC+5:30, Chris Angelico wrote: > On Mon, Jul 18, 2016 at 2:16 PM, Rustom Mody wrote: > > On Saturday, July 16, 2016 at 3:16:48 PM UTC+5:30, Steven D'Aprano wrote: > > Here are the first couple of hits it gives (me) for “scheme exact number” > > > > | Scheme

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-17 Thread Rustom Mody
On Monday, July 18, 2016 at 10:16:58 AM UTC+5:30, Ben Finney wrote: > You will be able to express yourself much more clearly on this topic > when you cease conflating a number with measurements of that number, or > conflating a number with representations of that number. > That more or less

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-17 Thread Ben Finney
Rustom Mody writes: > AIUI… > There are two almost completely unrelated notions of exact > > 1. ⅓ in decimal cannot be exactly represented though 0.3 0.33 etc are > approximations. We could call these inexact forms of ⅓ Better would be to use the term already used: 0.

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-17 Thread Chris Angelico
On Mon, Jul 18, 2016 at 2:16 PM, Rustom Mody wrote: > On Saturday, July 16, 2016 at 3:16:48 PM UTC+5:30, Steven D'Aprano wrote: > Here are the first couple of hits it gives (me) for “scheme exact number” > > | Scheme integers can be exact and inexact. For example, a number