freebsd-src/usr.bin/units
rilysh 0bdcfb08f2 usr.bin/units: use else..if to avoid calling the next branch
Even if the first branch succeeds, next time it will still check for
the second branch (which will be false) as the first one was true.
Add an else..if statement to address this.

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1165
2024-04-19 16:54:30 -06:00
..
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
definitions.units Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
README Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
units.1 Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
units.c usr.bin/units: use else..if to avoid calling the next branch 2024-04-19 16:54:30 -06:00

This is a program which I wrote as a clone of the UNIX 'units'
command.  I threw it together in a couple days, but it seems to work,
with some restrictions.  I have tested it under DOS with Borland C and
Ultrix 4.2, and SunOS 4.1.  

This program differs from the unix units program in the following
ways:
   it can gracefully handle exponents larger than 9 in output
   it uses 'e' to denote exponentiation in numbers
   prefixes are listed in the units file
   it tries both -s and -es plurals
   it allows use of * for multiply and ^ for exponentiation in the input
   the output format is somewhat different

Adrian Mariano (adrian@cam.cornell.edu or mariano@geom.umn.edu)