Subject: perl and quads
To: NetBSD Users <netbsd-users@netbsd.org>
From: Jukka Marin <jmarin@pyy.jmp.fi>
List: netbsd-users
Date: 09/09/2002 11:16:44
Hi,

I noticed that perl (version 5.6.1 from pkgsrc) supports 64-bit integers,
but the formatting chars in printf do not:

% cat /tmp/koe.pl
#!/usr/pkg/bin/perl

$foo = 2048*1024*1024;
printf("%u $foo\n", $foo);
$foo *= 2;
printf("%u $foo\n", $foo);
$foo *= 2;
printf("%u $foo\n", $foo);

% /tmp/koe.pl
2147483648 2147483648
4294967295 4294967296
4294967295 8589934592

What's wrong?  I'd like to use the formatting chars method to control
field widths etc. but now perl seems to limit the output value to 2^32-1.
Using %lu or %U doesn't help.

  -jm