Computer Old Farts Forum
 help / color / mirror / Atom feed
From: Ralph Corderoy <ralph@inputplus.co.uk>
To: coff@tuhs.org
Cc: Phil Budne <phil@ultimate.com>
Subject: [COFF] Re: A second Unix Patent
Date: Sat, 04 Mar 2023 15:15:53 +0000	[thread overview]
Message-ID: <20230304151553.AD3EC210F2@orac.inputplus.co.uk> (raw)
In-Reply-To: <202303041123.324BND9W061456@ultimate.com>

Hi Phil,

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

> >     $ 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
    8192

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
	    8
    $ units m '8 m'
	    * 0.125
	    / 8
    $

I found this when attempting the obvious

    $ units Kibyte 8bit
    conformability error
	    8192 bit
	    8
    $ 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: <202303041123.324BND9W061456@ultimate.com>]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20230304151553.AD3EC210F2@orac.inputplus.co.uk \
    --to=ralph@inputplus.co.uk \
    --cc=coff@tuhs.org \
    --cc=phil@ultimate.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).