This is a discussion on RE: [PHP] Math Weirdness within the PHP General forums, part of the PHP Programming Forums category; On 15 July 2008 14:33, tedd advised: > At 11:24 AM +0100 7/15/08, Ford, Mike wrote: &...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On 15 July 2008 14:33, tedd advised:
> At 11:24 AM +0100 7/15/08, Ford, Mike wrote: >> On 14 July 2008 20:47, tedd advised: >> >> > Round-off errors normally don't enter into things unless your doing >> > multiplication and division operations. At that point, > what you get >>> back from the operation is an approximation and not the actual >>> number. >> >> Bull! Nearly all computer floating point numbers are approximations >> because of being held in binary rather than decimal. Any number with a >> (decimal) fractional part that doesn't end with the digit 5 is >> necessarily an approximation, and that's only half the story. So as soon >> as you involve numbers like 0.1 or 0.2, you've already got minor >> inaccuracies which will propagate through any kind of arithmetic -- it's >> just worse with multiplication or division because these tend to result >> in inaccuracy in more significant digits! >> >> Bottom line: a floating point value should *always* be treated with an >> appropriate degree of suspicion. >> >> Cheers! >> >> Mike > > Mike: > > No reason to be rude. > > I said: > > "Round-off errors normally don't enter into things unless your doing > multiplication and division operations." > > And that is not "Bull" -- it's true. You can add and subtract all the > floating point numbers (the one's we are talking about here) you want > without any rounding errors whatsoever. Sorry, I do apologise if I came over too strongly -- there was no intention to offend. However, you really can't dismiss the effects of round-off errors on addition and subtraction as lightly as that. It's simply not true that approximations only occur at the point of doing multiplication and division -- there *are* approximations involved in addition and subtraction, and it is necessary to be aware that this is the case -- as Jay proved, 0.1+0.2 is hardly ever exactly 0.3. In this sort of case, it may well be that an appropriate degree of suspicion is simply to round to 2 decimal places at every stage, or compare the absolute difference to .001, but nonetheless one has to *know* that this is necessary. Ummm -- sorry, better </rant>, now!!! Cheers! Mike -- Mike Ford, Electronic Information Developer, C507, Leeds Metropolitan University, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.ford@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm |
|
|||
|
Robert Cummings schreef:
> On Tue, 2008-07-15 at 12:37 -0400, tedd wrote: >> At 12:31 PM -0400 7/15/08, Robert Cummings wrote: >>> Umm... here it is to unlimited precision: ¼ >>> >>> Cheers, >>> Rob. >> Yeah and here's ƒ >> >> Like or not, that's all there is to it. > > Weird... you're client bastar-dized my beautiful pi symbol. no it's the worst round error ever. how exactly do you go from 3.1 to .25 :-P > > Cheers, > Rob. |
|
|||
|
Jochem Maas wrote:
> Robert Cummings schreef: >> On Tue, 2008-07-15 at 12:37 -0400, tedd wrote: >>> At 12:31 PM -0400 7/15/08, Robert Cummings wrote: >>>> Umm... here it is to unlimited precision: ¼ >>>> >>>> Cheers, >>>> Rob. >>> Yeah and here's ƒ >>> >>> Like or not, that's all there is to it. >> >> Weird... you're client bastar-dized my beautiful pi symbol. > > no it's the worst round error ever. how exactly do you go > from 3.1 to .25 :-P Easy, subtract 2.85 -Shawn > >> >> Cheers, >> Rob. > |
|
|||
|
On Jul 16, 2008, at 11:39 AM, Shawn McKenzie wrote: > Jochem Maas wrote: >> Robert Cummings schreef: >>> On Tue, 2008-07-15 at 12:37 -0400, tedd wrote: >>>> At 12:31 PM -0400 7/15/08, Robert Cummings wrote: >>>>> Umm... here it is to unlimited precision: ¼ >>>>> >>>>> Cheers, >>>>> Rob. >>>> Yeah and here's ƒ >>>> >>>> Like or not, that's all there is to it. >>> >>> Weird... you're client bastar-dized my beautiful pi symbol. >> no it's the worst round error ever. how exactly do you go >> from 3.1 to .25 :-P > > Easy, subtract 2.85 And then put it in Jay's pocket since we know he's skimming! If you're lucky maybe he'll cut you in for not telling the boss :P -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 11287 James St Holland, MI 49424 www.raoset.com japruim@raoset.com |
|
|||
|
On Tue, Jul 15, 2008 at 3:50 PM, tedd <tedd.sperling@gmail.com> wrote:
> > Well, someone's client took infinity and turned it into an integral. > > tdd Yeah, but they stole your 'e' to make up for it. -- </Daniel P. Brown> Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. |