Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

od: doesn't support output format specifier "fL" #3096

Open
jfinkels opened this issue Feb 8, 2022 · 4 comments
Open

od: doesn't support output format specifier "fL" #3096

jfinkels opened this issue Feb 8, 2022 · 4 comments
Labels

Comments

@jfinkels
Copy link
Collaborator

jfinkels commented Feb 8, 2022

The uutils version of od does not support the fL output format specifier. It means "format the output as a floating point number, using sizeof(long double) bytes to interpret each number in the input". For more information, see: https://www.gnu.org/software/coreutils/manual/html_node/od-invocation.html

GNU od:

$ : | od -tfL
0000000

uutils od:

$ : | ./target/debug/od -tfL
./target/debug/od: unexpected char 'L' in format specification 'fL'

Here's the relevant part of the code:

// FormatTypeCategory::Float, 'L' => *byte_size = 16, // TODO support f128

@fritzrehde
Copy link

Is there a reason this hasn't been touched in a while? Does the difficulty lie in supporting 128 bit floats, which are not in the Rust standard library? Would we have to use an external crate to support them?

@tertsdiepraam
Copy link
Member

I suspect that's indeed the reason. We already have an external library for f16 (half), so another one for f128 makes sense to me. An RFC for both types is being worked on, but might take a while to land.

@tertsdiepraam
Copy link
Member

See here for the RFC: rust-lang/rfcs#3453.

It mentions the f128 crate which seems to be GCC only if I understand correctly? Maybe this just needs to be delayed until that RFC comes through then...

@fritzrehde
Copy link

fritzrehde commented Sep 4, 2023

I looked around a little as well, and many promising crates like rug are just wrappers around some GNU libraries. I'm not sure if using such crates go against the philosophy of this project, since they're not pure-rust. Furthermore, I read that installing rug on windows is not straightforward, and I'm guessing this project supports windows.
I would also agree that waiting for official Rust std lib support sounds like the best option for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants