home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!usc!news!netlabs!lwall
- From: lwall@netlabs.com (Larry Wall)
- Newsgroups: comp.lang.perl
- Subject: Re: Perl bug (Floating exception)
- Message-ID: <1992Nov16.193859.21980@netlabs.com>
- Date: 16 Nov 92 19:38:59 GMT
- References: <CONS.92Nov12180432@mercury.cern.ch>
- Sender: news@netlabs.com
- Distribution: comp
- Organization: NetLabs, Inc.
- Lines: 19
- Nntp-Posting-Host: scalpel.netlabs.com
-
- In article <CONS.92Nov12180432@mercury.cern.ch> cons@mercury.cern.ch (Lionel Cons) writes:
- : When I type:
- : perl -e '4646464646 % 3'
- : I get:
- : Floating exception (core dumped)
- :
- : What happens ?
-
- First note that:
-
- $ echo '2 ^ 32' | bc
- 4294967296
-
- The % operator performs an unsigned long operation, so it first converts (or,
- in this case, attempts to convert :-) both of its arguments to unsigned long.
-
- I'm not claiming this is optimal, but that's what it does.
-
- Larry
-