Skip to documentation
DocumentationAll documentsEnglish

A-D(1)

NAME

a-d - convert ASCII numbers to double-precision binary

On this page

SYNOPSIS

a-d [values ...] < ascii > doubles

DESCRIPTION

a-d converts decimal numbers in ASCII text into a stream of machine-native double-precision (8-byte) binary floating point values written to standard output.

If one or more numeric values are supplied on the command line, each is converted in order and written to standard output. Otherwise, the numbers are read from standard input, separated by whitespace. When reading from standard input, any line beginning with a '#' character is treated as a comment and ignored through the end of that line.

Because the output is raw binary, a-d refuses to run when standard output is a terminal. The inverse conversion, from binary doubles back to ASCII, is performed by d-a(1).

This command is deprecated and is scheduled for removal; it prints a deprecation warning on startup.

DEPRECATION

a-d is one of the legacy signal-analysis conversion filters that are being folded into the general-purpose data-conversion tool cv(1). New work should use cv(1), which performs the same ASCII-to-binary numeric conversions (and many others) through a single interface. a-d is retained for backward compatibility with existing scripts and still prints a deprecation warning when run.

EXAMPLES

Example 1. Convert command-line values to a binary double stream
a-d 1.0 2.5 -3.75 > values.d

Writes three 8-byte doubles (24 bytes total) to the file values.d.

Example 2. Pipe ASCII data through to a binary consumer
echo "# sample data
1.0 2.0 3.0" | a-d | d-a

Reads whitespace-separated numbers from standard input, skipping the leading comment line, converts them to binary doubles, and feeds the result to d-a(1) to convert it back to ASCII.

SEE ALSO

brlcad(1), d-a(1), dconv(1), dmod(1)

AUTHOR

BRL-CAD Team

This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org