Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Round to the nearest whole number?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 26 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sungwoo, Lim  
View profile  
 More options Nov 27 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: "Sungwoo, Lim" <sung...@cad.strath.ac.uk>
Date: 2000/11/27
Subject: Round to the nearest whole number?

Hello, I finally back. =)

Is there any function or macro which can "round to the nearest whole
number"?
For example, I want to round from the first decimals as
   3.51 -> 4
   3.4445 -> 3

Thanks for your help.

Sungwoo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rainer Joswig  
View profile  
 More options Nov 27 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Rainer Joswig <jos...@corporate-world.lisp.de>
Date: 2000/11/27
Subject: Re: Round to the nearest whole number?
In article <271120001453264352%sung...@cad.strath.ac.uk>, "Sungwoo,

Lim" <sung...@cad.strath.ac.uk> wrote:
> Hello, I finally back. =)

> Is there any function or macro which can "round to the nearest whole
> number"?
> For example, I want to round from the first decimals as
>    3.51 -> 4
>    3.4445 -> 3

> Thanks for your help.

> Sungwoo

? (ROUND 3.51)
4
-0.4900000000000002
? (ROUND 3.4445)
3
0.4445000000000001

--
Rainer Joswig, Hamburg, Germany
Email: mailto:jos...@corporate-world.lisp.de
Web: http://corporate-world.lisp.de/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sungwoo, Lim  
View profile  
 More options Nov 27 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: "Sungwoo, Lim" <sung...@cad.strath.ac.uk>
Date: 2000/11/27
Subject: Re: Round to the nearest whole number?
In article <joswig-F9A72B.15565127112...@news.is-europe.net>, Rainer

Oops, @.@;;;;
The answer was in my question!
Thanks, =)

Sungwoo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Haywood  
View profile  
 More options Nov 27 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Andy Haywood <andyhayw...@cwcom.net>
Date: 2000/11/27
Subject: Re: Round to the nearest whole number?
You've got to be careful with round because if number is exactly halfway
between two integers, then it is rounded to the one that is even.

(round 2.5)
=> 2

I would want it to return 3.

Andy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Nov 27 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@tfeb.org>
Date: 2000/11/27
Subject: Re: Round to the nearest whole number?

Andy Haywood <andyhayw...@cwcom.net> writes:
> You've got to be careful with round because if number is exactly halfway
> between two integers, then it is rounded to the one that is even.

> (round 2.5)
> => 2

> I would want it to return 3.

You probably wouldn't if you did lots of numerical stuff which used
ROUND, as round-upwards can lead to nasty upwards drifts in results.
There's a theorem showing why round-to-even is better by <someone> and
Knuth (or Knuth and <someone>).

(Of course `better' is not really absolute, you can compensate for the
upward drift I think, but it makes things fiddly, especially for
people (like me) who are naive about floating point).

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas A. Russ  
View profile  
 More options Nov 27 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: t...@sevak.isi.edu (Thomas A. Russ)
Date: 2000/11/27
Subject: Re: Round to the nearest whole number?

round

--
Thomas A. Russ,  USC/Information Sciences Institute          t...@isi.edu    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Johan Kullstam  
View profile  
 More options Nov 28 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Johan Kullstam <kulls...@ne.mediaone.net>
Date: 2000/11/28
Subject: Re: Round to the nearest whole number?

Andy Haywood <andyhayw...@cwcom.net> writes:
> You've got to be careful with round because if number is exactly halfway
> between two integers, then it is rounded to the one that is even.

> (round 2.5)
> => 2

> I would want it to return 3.

for that, you can use floor on 1/2 more.

* (floor (+ 2.5 1/2))
=> 3
   0.0

--
J o h a n  K u l l s t a m
[kulls...@ne.mediaone.net]
sysengr


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Nov 28 2000, 9:17 pm
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.net>
Date: 29 Nov 2000 01:34:28 +0000
Local: Tues, Nov 28 2000 8:34 pm
Subject: Re: Round to the nearest whole number?
* Andy Haywood <andyhayw...@cwcom.net>
| I would want it to return 3.

  If you want that, you don't want rounding, but some sort of fraudulent
  scheme perpetrated by merchants and banks and other money institutions
  who want to keep your round-off change.  Less rebelliously, the sum of
  _rounded_ values should equal the rounded sum of the unrounded values,
  and if this does not hold, you have an _unmathematical_ operation.

  However, you may well define your "rounding" function thus:

(defun penny-theft (number)
  (multiple-value-bind (rounded rest)
      (truncate (+ number .5))
    (values rounded (- rest .5))))

#:Erik
--
  Solution to U.S. Presidential Election Crisis 2000:
    Let Texas secede from the Union and elect George W. Bush their
    very first President.  All parties, states would rejoice.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Espen Vestre  
View profile  
 More options Nov 29 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Espen Vestre <espen@*do-not-spam-me*.vestre.net>
Date: 2000/11/29
Subject: Re: Round to the nearest whole number?

Erik Naggum <e...@naggum.net> writes:
>   If you want that, you don't want rounding, but some sort of fraudulent
>   scheme perpetrated by merchants and banks and other money institutions
>   who want to keep your round-off change.  

The normal "0.5-rounding rule" isn't as "fraudulent" as it first seems
if you use it for both debit and credit, i.e. if the numbers are
are evenly distributed around 0.
--
  (espen)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas A. Russ  
View profile  
 More options Nov 29 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: t...@sevak.isi.edu (Thomas A. Russ)
Date: 2000/11/29
Subject: Re: Round to the nearest whole number?

Erik Naggum <e...@naggum.net> writes:
>   ... the sum of
>   _rounded_ values should equal the rounded sum of the unrounded values,
>   and if this does not hold, you have an _unmathematical_ operation.

Actually, there really isn't any rounding scheme which preserves this
invariant, except in some statistical sense.  For example:

 (round (+ 2.2 2.2 2.2 2.2 2.2))
   vs
 (reduce #'= (mapcar #'round '(2.2 2.2 2.2 2.2 2.2)))

--
Thomas A. Russ,  USC/Information Sciences Institute          t...@isi.edu    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Harald Hanche-Olsen  
View profile  
 More options Nov 29 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Harald Hanche-Olsen <han...@math.ntnu.no>
Date: 2000/11/29
Subject: Re: Round to the nearest whole number?
+ Erik Naggum <e...@naggum.net>:

|   Less rebelliously, the sum of
|   _rounded_ values should equal the rounded sum of the unrounded values,
|   and if this does not hold, you have an _unmathematical_ operation.

Unmathematical in what sense?

* (let ((x 2.3) (y 2.4))
    (list '= (+ (round x) (round y)) (round (+ x y))))

(= 4 5)

As a mathematician, I don't call some operations unmathematical if
they fail to commute.

Anyway, round as defined in CL has the very desirable property that if
(+ x y) happens to be an integer, *then* (+ (round x) (round y))
equals (round (+ x y)).  So whether the honest merchant rounds
the value owed before computing your change or computes the change and
then rounds the result, the answer is the same.

--
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- Yes it works in practice - but does it work in theory?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Barry Margolin  
View profile  
 More options Nov 29 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Barry Margolin <bar...@genuity.net>
Date: 2000/11/29
Subject: Re: Round to the nearest whole number?
In article <pcoelzump3v....@thoth.home>,
Harald Hanche-Olsen  <han...@math.ntnu.no> wrote:

>Anyway, round as defined in CL has the very desirable property that if
>(+ x y) happens to be an integer, *then* (+ (round x) (round y))
>equals (round (+ x y)).  So whether the honest merchant rounds
>the value owed before computing your change or computes the change and
>then rounds the result, the answer is the same.

But just make sure that you don't buy more than two things at once!

Actually, the "merchant" that this issue often has more of an effect on is
the government, when computing sales tax.  The total tax often differs
depending on whether it's computed on each item or the final total.

--
Barry Margolin, bar...@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent M Pitman  
View profile  
 More options Nov 29 2000, 9:16 pm
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Thu, 30 Nov 2000 02:14:16 GMT
Local: Wed, Nov 29 2000 9:14 pm
Subject: Re: Round to the nearest whole number?

Barry Margolin <bar...@genuity.net> writes:
> But just make sure that you don't buy more than two things at once!

> Actually, the "merchant" that this issue often has more of an effect on is
> the government, when computing sales tax.  The total tax often differs
> depending on whether it's computed on each item or the final total.

Indeed.  This was a big formative dilemma in my childhood.  I got
$0.25 allowance per week, and comic books cost $0.12 for the small
ones or $0.25 for the large ones, with $0.13 being the point below
which tax was not assessed, so I would buy two $0.12 comic books
separately and save the penny over to buy a $0.25 comic book another
week with its unavoidable $0.01 tax.  This taught me a lot about
careful fiscal management...

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Nov 30 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@tfeb.org>
Date: 2000/11/30
Subject: Re: Round to the nearest whole number?
t...@sevak.isi.edu (Thomas A. Russ) writes:

> Actually, there really isn't any rounding scheme which preserves this
> invariant, except in some statistical sense.  For example:

The statistical sense is what matters though.  You want to try stop
your numerical algorithms drifting off into the sunset if you can.

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rahul Jain  
View profile  
 More options Nov 30 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: "Rahul Jain" <ra...@rice.edu>
Date: 2000/11/30
Subject: Re: Round to the nearest whole number?
In article <3184450468066...@naggum.net> on <3184450468066...@naggum.net>,

"Erik Naggum" <e...@naggum.net> wrote:
>   If you want that, you don't want rounding, but some sort of fraudulent
>   scheme perpetrated by merchants and banks and other money institutions
>   who want to keep your round-off change.  Less rebelliously, the sum of
>   _rounded_ values should equal the rounded sum of the unrounded values,
>   and if this does not hold, you have an _unmathematical_ operation

I found myself needing a "penny theft" rounding function when writing a
line rasterizer for a class assignment. Using the more standard rounding
procedure, the lines looked something like:

-
 -
  ---
     -
      -

--
-> -\-=-=-=-=-=-=-=-=-=-/^\-=-=-=<*><*>=-=-=-/^\-=-=-=-=-=-=-=-=-=-/- <-
-> -/-=-=-=-=-=-=-=-=-=/ {  Rahul -<>- Jain   } \=-=-=-=-=-=-=-=-=-\- <-
-> -\- "I never could get the hang of Thursdays." - HHGTTG by DNA -/- <-
-> -/- http://photino.sid.rice.edu/ -=- mailto:rahul-j...@usa.net -\- <-
|--|--------|--------------|----|-------------|------|---------|-----|-|
   Version 11.423.999.210020101.23.50110101.042
   (c)1996-2000, All rights reserved. Disclaimer available upon request.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Harald Hanche-Olsen  
View profile  
 More options Nov 30 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Harald Hanche-Olsen <han...@math.ntnu.no>
Date: 2000/11/30
Subject: Re: Round to the nearest whole number?
+ Barry Margolin <bar...@genuity.net>:

| In article <pcoelzump3v....@thoth.home>,
| Harald Hanche-Olsen  <han...@math.ntnu.no> wrote:
| >Anyway, round as defined in CL has the very desirable property that if
| >(+ x y) happens to be an integer, *then* (+ (round x) (round y))
| >equals (round (+ x y)).  So whether the honest merchant rounds
| >the value owed before computing your change or computes the change and
| >then rounds the result, the answer is the same.
|
| But just make sure that you don't buy more than two things at once!

Actually, what I wrote isn't even true, as the example x=y=2.5 shows
all too clearly.

(unless (improves (quality (usenet-posts me)))
  (revert-to-lurking-mode))

--
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- Yes it works in practice - but does it work in theory?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
cbbrowne  
View profile  
 More options Nov 30 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: cbbro...@hex.net
Date: 2000/11/30
Subject: Re: Round to the nearest whole number?
>>>>> "Erik" == Erik Naggum <e...@naggum.net> writes:

Erik> * Andy Haywood <andyhayw...@cwcom.net> | I would want it to
Erik> return 3.

Erik>   If you want that, you don't want rounding, but some sort of
Erik> fraudulent scheme perpetrated by merchants and banks and other
Erik> money institutions who want to keep your round-off change.  Less
Erik> rebelliously, the sum of _rounded_ values should equal the
Erik> rounded sum of the unrounded values, and if this does not hold,
Erik> you have an _unmathematical_ operation.

Um, "mathematics" isn't as stringent as you seem to be indicating
here.

It would be _nice_ if the sum of the rounded values should equal the
rounding of the sum of the unrounded values; that isn't necessarily
possible.

After all, suppose we have:
   (defvar values '(2.2 3.2 4.2 5.2))
and want to round to the nearest integer.

[4]> (apply #'+ values)

14.8

The reasonable rounding of that total would be to 15.

The _reasonable_ rounding of the individual values would get you
  (2 3 4 5)
whose sum is 14.

I can't think of a reasonable rounding rule that would round just
_one_ of those four values up so as to satisfy your expectation that:

> (equal (our-round (apply #'+ values))

         (apply #'+ (mapcar #'our-round values)))
T

I don't think that there _is_ a "mathematical operation" to correspond
to our-round.

Erik>   However, you may well define your "rounding" function
Erik> thus:

Erik> (defun penny-theft (number) (multiple-value-bind (rounded
Erik> rest) (truncate (+ number .5)) (values rounded (- rest
Erik> .5))))

Providing a somewhat more elaborate set of examples:

(defparameter *sample1* '(2.2 3.2 4.2 5.2 6.2 7.2 8.2 9.2 10.2))
(defparameter *sample2*
  (list (random 15.2)(random 15.2)(random 15.2)(random 15.2)(random 15.2)
        (random 15.2)(random 15.2)(random 15.2)(random 15.2)(random 15.2)))

(defun rounding-naggum-penny-theft (number)
  (multiple-value-bind
      (rounded rest)
      (truncate (+ number .5))
    (values rounded (- rest .5))))

(defun round-to-even (number)
  "Rounds to the nearest integer; breaks ties by rounding to a round integer."
  (multiple-value-bind
      (int-part fp-part)
      (truncate number)
    (let ((new-int (cond
                    ((> fp-part 0.5) (+ int-part 1))
                    ((< fp-part 0.5) int-part)
                    (t
                     (if (evenp int-part)
                         int-part
                       (+ int-part 1))))))
      (values new-int (- number new-int)))))

(format t "Round-then-add gives: ~D~%Add-then-round gives: ~D~%"
        (apply #'+ (mapcar #'round-to-even *sample1*))
        (round-to-even (apply #'+ *sample1*)))

(format t "Round-then-add gives: ~D~%Add-then-round gives: ~D~%"
        (apply #'+ (mapcar #'rounding-naggum-penny-theft *sample1*))
        (rounding-naggum-penny-theft (apply #'+ *sample1*)))

(format t "Round-then-add gives: ~D~%Add-then-round gives: ~D~%"
        (apply #'+ (mapcar #'round *sample1*))
        (round (apply #'+ *sample1*)))

(format t "Round-then-add gives: ~D~%Add-then-round gives: ~D~%"
        (apply #'+ (mapcar #'round-to-even *sample2*))
        (round-to-even (apply #'+ *sample2*)))

(format t "Round-then-add gives: ~D~%Add-then-round gives: ~D~%"
        (apply #'+ (mapcar #'rounding-naggum-penny-theft *sample2*))
        (rounding-naggum-penny-theft (apply #'+ *sample2*)))

(format t "Round-then-add gives: ~D~%Add-then-round gives: ~D~%"
        (apply #'+ (mapcar #'round *sample2*))
        (round (apply #'+ *sample2*)))

; Results:
; Round-then-add gives: 54
; Add-then-round gives: 56
; Round-then-add gives: 54
; Add-then-round gives: 56
; Round-then-add gives: 54
; Add-then-round gives: 56
; Round-then-add gives: 65
; Add-then-round gives: 64
; Round-then-add gives: 65
; Add-then-round gives: 64
; Round-then-add gives: 65
; Add-then-round gives: 64

Add-then-round gives different results from Round-then-add for _ALL_
of these rounding policies.  So either they're all "unmathematical,"
or perhaps your expectations are a bit too high...
--
(concatenate 'string "cbbrowne" "@hex.net")
<http://www.ntlug.org/~cbbrowne/>
DO IT -- it's easier to get forgiveness than permission.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
cbbrowne  
View profile  
 More options Nov 30 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: cbbro...@hex.net
Date: 2000/11/30
Subject: Re: Round to the nearest whole number?

>>>>> "Andy" == Andy Haywood <andyhayw...@cwcom.net> writes:

    Andy> You've got to be careful with round because if number is
    Andy> exactly halfway between two integers, then it is rounded to
    Andy> the one that is even.

    Andy> (round 2.5) => 2

    Andy> I would want it to return 3.

It's fair enough to say that someone rounding the price of a product
after doing tax calculations might prefer to round up if, at all
possible, so as to charge the customer as much as possible.

The "round an exact-half to the nearest even value" is the convention
I've always seen in science courses, and is a good policy if you don't
want bias.
--
(concatenate 'string "cbbrowne" "@ntlug.org")
<http://www.ntlug.org/~cbbrowne/>
Rules of the Evil Overlord #15. "I will never employ any device with
a digital countdown. If I find that such a device is absolutely
unavoidable, I will set it to activate when the counter reaches 117
and the hero is just putting his plan into operation."
<http://www.eviloverlord.com/>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Monfera  
View profile  
 More options Nov 30 2000, 10:11 pm
Newsgroups: comp.lang.lisp
From: Robert Monfera <monf...@fisec.com>
Date: Fri, 01 Dec 2000 03:11:54 GMT
Local: Thurs, Nov 30 2000 10:11 pm
Subject: Re: Round to the nearest whole number?
Though banks' total assets and liabilities equal, deposits (liabilities)
are always much more fragmented, resulting in a higher number of
rounding on the liability side.

Robert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Espen Vestre  
View profile  
 More options Dec 1 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Espen Vestre <espen@*do-not-spam-me*.vestre.net>
Date: 2000/12/01
Subject: Re: Round to the nearest whole number?

Robert Monfera <monf...@fisec.com> writes:
> Though banks' total assets and liabilities equal, deposits (liabilities)
> are always much more fragmented, resulting in a higher number of
> rounding on the liability side.

yes, that would mean that in this case the statistical distribution is
'skewed', I guess. My statistics knowledge is too limited (and old) to
grasp the whole picture here, but roughly, the 'bean counter rule' will
probably be 'fair' for all symmetric distributions (which isn't the case
here) with E=0. The lisp rule will be 'fair' for a much broader class of
statistical distributions (with no _general_ limitation on the expected
value of the distribution), but still not all.
--
  (espen)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Simbuerger t2002  
View profile  
 More options Dec 4 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Stefan Simbuerger t2002 <Stefan.Simbuer...@physik.uni-regensburg.de>
Date: 2000/12/04
Subject: Re: Round to the nearest whole number?
Path: uni-regensburg.de!news-nue1.dfn.de!uni-erlangen.de!newsfeeds.belnet.be!news .belnet.be!news.tele.dk!129.240.148.23!uio.no!Norway.EU.net!127.0.0.1!nobod y
From: Erik Naggum <e...@naggum.net>
Newsgroups: comp.lang.lisp
Subject: Re: Round to the nearest whole number?
Date: 29 Nov 2000 01:34:28 +0000
Organization: Naggum Software; vox: +47 800 35477; gsm: +47 93 256 360; fax: +47 93 270 868; http://naggum.no; http://naggum.net
Lines: 21
Message-ID: <3184450468066295@naggum.net>
References: <271120001453264352%sungwoo@cad.strath.ac.uk> <joswig-F9A72B.15565127112000@news.is-europe.net> <271120001510300782%sungwoo@cad.strath.ac.uk> <3A228DA5.9A61BD27@cwcom.net>
NNTP-Posting-Host: gate.dn.nhst.no
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: oslo-nntp.eunet.no 975464222 12922 195.0.192.66 (29 Nov 2000 02:17:02 GMT)
X-Complaints-To: newsmaster@eunet.no
NNTP-Posting-Date: 29 Nov 2000 02:17:02 GMT
mail-copies-to: never
User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7
Xref: uni-regensburg.de comp.lang.lisp:45623

* Erik Naggum
| Less rebelliously, the sum of _rounded_ values should equal the
| rounded sum of the unrounded values, and if this does not hold, you
| have an _unmathematical_ operation.

What do you mean by "unmathematical"?  A function in mathematics, say f,
is usually defined as a mapping from some set S to some number field R
in a way as to assign every x from S to some f(x) from R.  Note that f
does not necessarily have to be _homomorphic_ (if S has no + operation
this is clear from the outset), i.e. in general f(x+y) /= f(x)+f(y)
holds.

Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Dec 4 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.net>
Date: 2000/12/04
Subject: Re: Round to the nearest whole number?
* Stefan Simbuerger
| What do you mean by "unmathematical"?

  An exaggeration intended to be so blatantly exaggerated that it would
  at least seem somewhat humorous to at least one person beside myself.
  With a rounding function called "penny-theft" and words like "less
  rebelliously", I'm _amazed_ that not a single soul could lighten up.

#:Erik, sighing
--
  "When you are having a bad day and it seems like everybody is trying
   to piss you off, remember that it takes 42 muscles to produce a
   frown, but only 4 muscles to work the trigger of a good sniper rifle."
                                                                -- Unknown


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Harald Hanche-Olsen  
View profile  
 More options Dec 5 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Harald Hanche-Olsen <han...@math.ntnu.no>
Date: 2000/12/05
Subject: Re: Round to the nearest whole number?
+ Erik Naggum <e...@naggum.net>:

| * Stefan Simbuerger
| | What do you mean by "unmathematical"?
|
|   An exaggeration intended to be so blatantly exaggerated that it would
|   at least seem somewhat humorous to at least one person beside myself.
|   With a rounding function called "penny-theft" and words like "less
|   rebelliously", I'm _amazed_ that not a single soul could lighten up.

Well, mathematicians of course have no sense of humour, since humour
cannot be expressed in Zermelo-Fraenkel set theory.  Not to mention
that humour (the good kind) is usually self-referential, and this
would tie us into some kind of Gödelian knot if we tried it.

Lispers thrive on self-reference of course, since lambda calculus has
no problems dealing with it.  So they're always full of fun.  Which is
why I lurk (most of the time) on this newsgroup, trying to figure out
what this humour thing is all about.

I'll bet it isn't all it's cracked up to be, though.

--
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- Yes it works in practice - but does it work in theory?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
cbbrowne  
View profile  
 More options Dec 5 2000, 9:35 pm
Newsgroups: comp.lang.lisp
From: cbbro...@hex.net
Date: Wed, 06 Dec 2000 02:34:46 GMT
Local: Tues, Dec 5 2000 9:34 pm
Subject: Re: Round to the nearest whole number?

Erik Naggum <e...@naggum.net> writes:
> * Stefan Simbuerger
> | What do you mean by "unmathematical"?

>   An exaggeration intended to be so blatantly exaggerated that it
>   would at least seem somewhat humorous to at least one person
>   beside myself.  With a rounding function called "penny-theft" and
>   words like "less rebelliously", I'm _amazed_ that not a single
>   soul could lighten up.

> #:Erik, sighing

You think that the long presentation was intended to be
heavy-hearted?!?  [Besides which, based on the pretty dramatically
different understandings of "abusive" that people have on this
newsgroup, why would it be reasonable to expect a common understanding
of humour?]

>   "When you are having a bad day and it seems like everybody is trying
>    to piss you off, remember that it takes 42 muscles to produce a
>    frown, but only 4 muscles to work the trigger of a good sniper rifle."
>                                                            -- Unknown

Actually, _that_ quote is likely attributable to my little brother,
Brad...  I don't know that he was the _first_ to say it, but say it,
I'm sure he has.  Last time I went shooting, it was at the trigger of
a "good sniper rifle..."
--
(concatenate 'string "cbbrowne" "@hex.net") <http://www.ntlug.org/~cbbrowne/>
As usual,  this being  a 1.3.x release,  I haven't even  compiled this
kernel yet.   So if it works,  you should be  doubly impressed. (Linus
Torvalds, announcing kernel 1.3.3 on the linux-kernel mailing list.)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Dec 5 2000, 11:17 pm
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.net>
Date: 06 Dec 2000 03:41:17 +0000
Local: Tues, Dec 5 2000 10:41 pm
Subject: Re: Round to the nearest whole number?
* Christopher Browne
| [Besides which, based on the pretty dramatically different
| understandings of "abusive" that people have on this newsgroup, why
| would it be reasonable to expect a common understanding of humour?]

  Because it's a much simpler concept, even though both are essentially
  destructive in nature and it is always hard to agree on what should be
  destroyed because of the complexity of the concept of justice..  Those
  who object to "abusive" out of a gut feeling do not object to "humor",
  even though the latter is sometimes more destructive.  E.g., nobody
  has arrested that ridiculously pompous nincompoop Marcus G.  Daniels
  for any of his attempts at purely destrucdtive "humor", but if anyone
  is abusive towards the expectation of respect for _people_ in this
  forum, he's your best bet.  Light-heartedness is something other than
  humor, though.  And lightening up is the opposite of pompousness.

#:Erik
--
  "When you are having a bad day and it seems like everybody is trying
   to piss you off, remember that it takes 42 muscles to produce a
   frown, but only 4 muscles to work the trigger of a good sniper rifle."
                                                                -- Unknown


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 26   Newer >
« Back to Discussions « Newer topic     Older topic »