Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Oct 2001 23:48:22 +0200 (CEST)
From:      System Operator <operator%disp@citylink.dinoex.sub.de>
To:        freebsd-bugs@freebsd.org
Subject:   handling figures above 2/4 billions
Message-ID:  <200110272148.f9RLmMj14875@disp.oper.dinoex.org>

next in thread | raw e-mail | index | archive | help
 Hello together,

after upgrading from 2.2.1 to 4.x I noticed all my backup-shellscripts
were broken. (These are kind of a simple tape-library, self-written).

Obviousely, the bytecount on tapes reaches well beyond 2G/4G.

On 2.2.1, expr could not handle such figures. But awk could. awk 
strangely changed from left-justified to right-justified when 
figures went beyond 2G, but the math was correct.

Now with 4.x RELEASE, awk does something much more stupid:

$ awk 'END{printf "%-.20d\n", 4200000000}' < /dev/null
00000000004200000000
$ awk 'END{printf "%-.20d\n", 4300000000}' < /dev/null
4300000000

This is not useful at all.

( %-.20d is the only formatstring that prevents awk from automati-
cally switching to scientific float representation.)

As far as I see, expr is now capable of handling such large figures.
So possibly expr is the way to go on 4.x.

I will not file a bug-report because I do not know if awk is
designed to do 64bit-math at all (or if it just worked by chance
in 2.2.1). I also do not know what kind of sense could be seen
in this zero-filling (if any).

So whoever might know why this was changed in awk (or in the
underlying lib?), may just drop me a note.

rgds,PMc

P.S. I will currently not search for this myself, because getting
my backup-engine running again is much more vital to me.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110272148.f9RLmMj14875>