D-F(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸ’– 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 of 1.0 is retained so that data already sitting in the range -1.0 to +1.0 is 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 🫢


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