From:

Date:

March 8, 2001 07:31Subject:

Re: [ID 20010305.005] "use integer" doesn't make rand() return integersMessage ID:

Pine.SOL.3.91.1010308102346.3159A-100000@gateway.grumman.comOn Wed, 7 Mar 2001, Ronald J Kimball wrote: > On Wed, Mar 07, 2001 at 11:15:33PM +0100, abigail@foad.org wrote: > > After all, does it make any sense that '* 1' isn't an identity operation? > > > > I find: > > > > 1 * sin (1) != sin (1) > > > > to be utterly unintuitive. Now, I don't really care in this case because > > trig functions aren't particular useful when doing integer arithmetic. > > How do you feel about: > > 1 * 3.5 != 3.5 > > ? (Except that when you do the comparison, the operands are truncated to > integers. :) Wow. The fact that "use integer" affects comparison operators too does not seem to be mentioned anywhere in the pods. Not even in my recent patch to integer.pm :-). I have a fix for that, but before I send it, should "use integer" affect the increment and decrement ops? It doesn't now. I think I'd call that a bug. perl -Minteger -e '$x=1.3; --$x; print "$x "; ++$x; print $x' 0.3 1.3 John. PS - integer.pm also had a busted pod link L<perlmod/Pragmatic Modules>, which I changed to L<perlmodlib/"Pragmatic Modules">. Is there someone who has code to check for broken pod links?Thread Previous | Thread Next

- [ID 20010305.005] "use integer" doesn't make rand() return integers by fanf
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by rspier
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by John L. Allen
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by John Peacock
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by rspier
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by John Peacock
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by rspier
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by Walt Mankowski
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by abigail
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by John L. Allen
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by John Peacock
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by Philip Newton
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by Tony Finch
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by Philip Newton
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by rspier
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by John Peacock
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by Philip Newton
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by abigail
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by John Peacock
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by abigail
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by John Peacock
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by abigail
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by Ronald J Kimball
**Re: [ID 20010305.005] "use integer" doesn't make rand() return integers**by John L. Allen- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by abigail
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by Bryan C . Warnock
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by abigail
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by Bryan C . Warnock
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by Nicholas Clark
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by Bryan C . Warnock
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by abigail
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by Bryan C . Warnock
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by John Peacock
- Re: [ID 20010305.005] "use integer" doesn't make rand() return integers by John Peacock

nntp.perl.org: Perl Programming lists via nntp and http.

Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About