atoq - Linux


Overview

atoq converts an ASCII string representation of a large floating-point number to its internal binary representation.

Syntax

atoq [options] [number]

Options/Flags

  • -h, –help: Display help and usage information.
  • -V, –version: Display version information.

Examples

Convert the ASCII string representation "1234567890.1234567890" to its internal binary representation:

atoq 1234567890.1234567890

Output:

4640821937157779742

Common Issues

  • Invalid input: atoq expects a valid ASCII string representation of a large decimal floating-point number. Invalid input will result in an error.
  • Overflow: If the input number exceeds the representable range of the internal binary representation, atoq will return an ERANGE error.

Integration

atoq is commonly used in conjunction with other commands or tools, such as:

  • bc: To perform arbitrary-precision arithmetic operations on the binary representation of the number.
  • awk: To extract numeric data from complex text formats and convert it to the internal binary representation.

Related Commands

  • printf: To generate ASCII string representations of numbers.
  • printf("%Lf") in glibc to print a large floating-point number as a string.