🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.theory
Article #2091

Re: What if the Divisor is Negative? (was Re: Modulus)

#2091
From: Steven Pemberton
Date: Mon, 26 Feb 1990 14:11
18 lines
1370 bytes
In article <Efc#2s@cs.psu.edu> callahan@cs.psu.edu (Paul B. Callahan) writes:
> Thus, we define
>                  m div n = floor(m/n)
>                  m mod n = m - n*(m div n) 
[...]
> Another nice thing about this definition is that m and n need not be
> integers. In fact, if n is 2*pi and and m is some arbitrary real,
> then we can use this formula to force an angle into the interval [0,2*pi).
And you can get the fractional part of m with
		   m mod 1

For an example of a language that adopts this approach (and gets mod
right :-), see ABC, recently posted to the net.

Steven Pemberton, CWI, Amsterdam; steven@cwi.nl
"Let us go then you and I/while the night is laid out against the sky/like a
					smear of mustard on an old pork pie"
Nice poem Tom. I have ideas for changes though, why not come over? - Ezra
Technical Details
Message-ID: <8839@boring.cwi.nl>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!charon!steven
References: <4356@daffy.cs.wisc.edu> <Efc#2s@cs.psu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!charon!steven
From: steven@cwi.nl (Steven Pemberton)
Newsgroups: comp.theory,comp.misc,comp.lang.misc
Subject: Re: What if the Divisor is Negative?  (was Re: Modulus)
Message-ID: <8839@boring.cwi.nl>
Date: 26 Feb 90 14:11:33 GMT
References: <4356@daffy.cs.wisc.edu> <Efc#2s@cs.psu.edu>
Sender: news@cwi.nl (The Daily Dross)
Reply-To: steven@valk.cwi.nl.UUCP (Steven Pemberton)
Followup-To: comp.theory
Organization: CWI, Amsterdam
Lines: 18