Re: bug in remainder ?

new topic     » goto parent     » topic index » view thread      » older message » newer message

# On Thu, 3 Feb 2000 16:09:48 -0500, Brian Broker <bkb at CNW.COM> wrote:
#
# >On Thu, 3 Feb 2000 20:21:04 +0000, Daniel Johnson wrote:
# >
# >>? remainder(1,.1)
# >>.1
# >>? remainder(1,.01)
# >>.01
# >>? remainder(10,1)
# >>1
# >I get:
# >0.1
# >0.01
# >0
# Hmmm... now that I think about it, shouldn't they all be zero?  What am I
# missing here?

Oooh. Back on the list and made a fool of myself already getlost
your results are the same as mine, I just had a parity error during the serial
transfer from screen to brain back to screen.

I am not completely sure exactly what a remainder is when you leave the comfy
world of integers, but this behaviour does seem somewhat illogical.

If I had written the remainder function (and it had no bugs in) they would all
be 0. Rob can you set the record straight on this one ?

--

Daniel Johnson               Engineer, smartypants and clown
Jesus College, Cambridge     all at a very reasonable price
dpj22 at cam.ac.uk
zeus.jesus.cam.ac.uk/~dpj22  talk dpj22 at jewish.jesus.cam.ac.uk

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu