home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / perl / 6999 < prev    next >
Encoding:
Internet Message Format  |  1992-11-16  |  933 b 

  1. Path: sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!usc!news!netlabs!lwall
  2. From: lwall@netlabs.com (Larry Wall)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: Perl bug (Floating exception)
  5. Message-ID: <1992Nov16.193859.21980@netlabs.com>
  6. Date: 16 Nov 92 19:38:59 GMT
  7. References: <CONS.92Nov12180432@mercury.cern.ch>
  8. Sender: news@netlabs.com
  9. Distribution: comp
  10. Organization: NetLabs, Inc.
  11. Lines: 19
  12. Nntp-Posting-Host: scalpel.netlabs.com
  13.  
  14. In article <CONS.92Nov12180432@mercury.cern.ch> cons@mercury.cern.ch (Lionel Cons) writes:
  15. : When I type:
  16. :    perl -e '4646464646 % 3'
  17. : I get:
  18. :    Floating exception (core dumped)
  19. : What happens ?
  20.  
  21. First note that:
  22.  
  23.     $ echo '2 ^ 32' | bc
  24.     4294967296
  25.  
  26. The % operator performs an unsigned long operation, so it first converts (or,
  27. in this case, attempts to convert :-) both of its arguments to unsigned long.
  28.  
  29. I'm not claiming this is optimal, but that's what it does.
  30.  
  31. Larry
  32.