DMOD(1)
π DMOD(1) β dmod: apply arithmetic operations to a stream of doubles π
β¨ NAME β¨
dmod β apply arithmetic operations to a stream of doubles. Main character energy for binary double math, no cap. π«Ά
π SYNOPSIS π
dmod [-a add] [-s sub] [-m mult] [-d div] [-A] [-e exp] [-r root] [doubles]
π¦ DESCRIPTION π¦
Okay so dmod reads a stream of 64-bit double-precision floating-point numbers, applies one or more arithmetic operations to every value, and writes the modified doubles to standard output. Itβs giving βtiny math pipeline, huge slay.β β¨
You can stack any number of add, subtract, multiply, divide, absolute value, or exponentiation operations on the command line. They get applied to each value in the order they appear, so the operations form a left-to-right pipeline. Order matters, bestie β the vibe check is sequential. π
If a file argument is supplied, dmod reads from it; otherwise it reads from standard input. Both the input and output are raw binary doubles, so the standard input and output must not be a terminal. Do not point raw binary doubles at your terminal unless you want glitch-chaos energy π. See dconv(1) and d-i(1) for converting between doubles and other numeric formats. π¦
π OPTIONS π
-aval β add val to each number. β¨-sval β subtract val from each number. πΈ-mval β multiply each number by val. π-dval β divide each number by val. A val of zero is rejected. π-Aβ replace each number with its absolute value. π-eval β raise each number to the power val. π₯-rval β take the val-th root of each number (raise to the power1/val). A val of zero is rejected. π-h,-?β print a usage message and exit. π«Ά
π EXAMPLES π
π Example 1. Rescale a height field to inches and clamp negatives
dmod -m 0.0393701 -A terrain_mm.d > terrain_in_pos.d
Reads doubles from terrain_mm.d (values in millimeters), multiplies each by 0.0393701 to convert to inches, then takes the absolute value to remove any negative elevations, writing the result to terrain_in_pos.d. Operations are applied left to right, so the scaling happens before the absolute value. Iconic, honestly. π
π§ SEE ALSO π§
brlcad(1), dconv(1), d-i(1), d-f(1) β go give these a read too, bestie π
π AUTHOR π
BRL-CAD Team β the whole squad. π
π COPYRIGHT π
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. Please do tell them, fr fr β bug reports are self-care. π«Ά
π BRL-CAD β’ DMOD(1) β’ thatβs the whole page, bestie β bye! π
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms