Computer Old Farts Forum
 help / color / mirror / Atom feed
From: Ralph Corderoy <>
Cc: Phil Budne <>
Subject: [COFF] Re: A second Unix Patent
Date: Sat, 04 Mar 2023 15:15:53 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Phil,

Copying to the COFF list, hope that's okay.  I thought it might interest

> >     $ units -1v '26^3 16 bit' 64KiB
> Works only for GNU units.

That's interesting, thanks.

I've access to a FreeBSD 12.3-RELEASE-p6, if that version number means
something to you.  Its units groks ^ to mean power when applied to a
unit, as the fine units(1) says, but not to a number.  Whereas * works.

    $ units yd^3 ft^3
            * 27
            / 0.037037037
    $ units 6\*7 21
            * 2
            / 0.5
    $ units 2^4 64 
            * 0.03125
            / 32

The last one silently treats 2^4 as 2; I'd say that's a bug.

It has Ki- and byte allowing

    $ units -t Kibyte bit

but lacks GNU's

    B   byte

Fair enough, though I think that's common enough now to be included.

FreeBSD also seems to have another bug: demanding a space between the
quantity and the unit for fundamental ‘!’ units.

    $ units m 8m
    conformability error
	    1 m
    $ units m '8 m'
	    * 0.125
	    / 8

I found this when attempting the obvious

    $ units Kibyte 8bit
    conformability error
	    8192 bit
    $ units Kibyte '8 bit'
	    * 1024
	    / 0.0009765625

Whilst I'm not a GNU acolyte, in this case its version of units does
seem to have had a bit more TLC.  :-)

Cheers, Ralph.

           reply	other threads:[~2023-03-04 15:16 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).