D-F(1)
π D-F(1) β the d-f page, bestie edition π
okay so welcome to the D-F manual page, from the BRL-CAD fam β¨ pull up a chair, grab a boba, and let's talk about squishing big floats into small floats π«Ά
πΈ NAME πΈ
d-f β converts double-precision floats into single-precision floats. that's it, that's the whole job, and it does it beautifully π
β¨ SYNOPSIS β¨
d-f [-n | scale] < doubles > floats
likeβ¦ look at her. she's got options (literally two of them) but she's lowkey simple π
π¦ DESCRIPTION π¦
so here's the vibe: d-f reads a whole stream of machine-native double-precision (that's 8-byte) binary floating point values from standard input, converts every single one into a single-precision (4-byte) binary float, and writes the results out to standard output. no cap, that's the entire personality π
you can pass an optional argument to control scaling. if you give it a numeric scale, every value gets multiplied by it during the conversion. and if you use the -n flag instead, that selects normalized output, leaving the unit scale of 1.0 in effect. with no argument at all? the values just get converted unchanged, no drama, no notes β¨
now here's the part where you gotta listen, bestie π because the input and output are raw binary, d-f straight up refuses to run when standard input or standard output is a terminal (fr fr, it will not do it), and it also rejects a scale of zero. those are the rules, we don't make them, we just respect them π
the inverse conversion β going from single-precision floats back to doubles β is handled by f-d(1). so they're like a lil duo π«Ά
β οΈ heads up bestie: this command is deprecated and is scheduled for removal. it prints a deprecation warning on startup, so don't say nobody told you π
π OPTIONS π
-nβ normalizes the data. the unit scale factor of1.0is retained so that data already sitting in the range-1.0to+1.0is preserved. it's giving "leave it as it is but make it official" πscaleβ a numeric multiplier applied to every value as it's converted. may not be zero π« (that's the one hard no)
π EXAMPLES π
β Example 1. Halve the amplitude of a double stream
d-f 0.5 < signal.d > signal.f
this reads double-precision samples out of signal.d, scales each one by a half, and writes single-precision floats into signal.f. the result? a more compact file at reduced amplitude β smaller file, chiller vibes, we love a glow-down that saves disk space π
β Example 2. Round-trip through single precision
d-f < values.d | f-d > rounded.d
converts doubles to floats and then back again with f-d(1). this is genuinely a convenient way to see the precision you lose when signal-processing data gets stored as single-precision floats by tools like dconv(1) or dmod(1). it's giving "let's go around the world and see what we lost" π§
π SEE ALSO π
brlcad(1), f-d(1), dconv(1), dmod(1) β go read them, they're iconic too π
π AUTHOR π
BRL-CAD Team β the main characters responsible for all of this π«Ά
πΈ COPYRIGHT πΈ
this software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. periodt π
π¦ BUG REPORTS π¦
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. found something cursed? tell the devs, not me, i'm just the messenger ππ¬
and that's the whole page, bestie!! π go forth and convert your doubles, remember she's deprecated (sad but true π), and if you see the BRL-CAD crew and the D-F(1) footer floating around, that's just the source, version and date doing their lil sign-off dance β mwah, love u, 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