[Sussex] Challenge

Geoff Teale Geoff.Teale at claybrook.co.uk
Wed Apr 30 10:52:01 UTC 2003


Steve wrote:
------------
> Ohhhh a challenge

Indeed :)

> Here is my solution when working in base 2 throughout:
> 
> $ bc
> scale=99
> ibase=2
> obase=2
> 1.0 / 1010.0
> 1010.0 * (1.0 / 1010.0)
> quit
> $
> 
> Tested on a Sparc 64 (Solaris 8) and Cygwin and both produced 
> a 1.0000...000 result.  I haven't published to output from 
> bc, I'll leave that up to the judge.
>
> Do I pass?

Well, I don't have bc to hand to check your working, but in any case, no you
don't.  Any exisiting tool that does result in the correct answer is using a
"fudge factor" in software for common cases - this is not uncommon for luser
tools, VB and Excel on Windows behave similarly.  You have yet to show a
binary representation of the decimal fraction 0.1, your underlying
represntation was in accordance to IEEE 754, and thus only an aproximation
expressed to 53bits. 

> Mine's a pint of ale (Horsham Best Bitter is quite drinkable).

Now, now, don't jump the gun ;)  Given that this challenge is not possible
in the bounds of Mathematics as we now understan it, I am looking for the
best _arguement_, please try again.

-- 
GJT
Free Software, Free Society. 
http://www.fsf.org   http://www.gnu.org


The above information is confidential to the addressee and may be privileged.  Unauthorised access and use is prohibited.
 
Internet communications are not secure and therefore this Company does not accept legal responsibility for the contents of this message.
 
If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.
 
Claybrook Computing Limited is a subsidiary of Claybrook Computing (Holdings) Limited
Registered Office: Abbey House. 282 Farnborough Road, Farnborough, Hampshire GU14 7NJ
Registered in England and Wales No 1287205
 
A Hogg Robinson plc company





More information about the Sussex mailing list