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

dBm is missing #103

Open
Kezii opened this issue Aug 6, 2021 · 3 comments
Open

dBm is missing #103

Kezii opened this issue Aug 6, 2021 · 3 comments

Comments

@Kezii
Copy link

Kezii commented Aug 6, 2021

unit of power
https://en.wikipedia.org/wiki/DBm

@robryk
Copy link

robryk commented May 24, 2024

In general, dB{anyunit} (and plain unitless dB) would be nice but potentially challenging to handle. One would need to handle addition (dB{someunit} + dB{someotherunit} yields dB{someunit*someotherunit}) and probably forbid multiplication. Unit conversions from/to log units should be straightforward, but I suspect they might look confusing with standard operator precedence.

It might also be nice to actually handle B and {otherSIprefix}B, but OTOH I've nearly never saw those used.

@tiffany352
Copy link
Owner

Yeah, it will require being handled specially in the syntax and come with a special data type. It will be similar to how temperatures (acting as postfix operators) and datetimes (acting as a special data type) are handled.

The nice thing is that once this special handling is added, it will be possible to reuse it for other non-linear scales, like pH and the Richter scale.

@robryk
Copy link

robryk commented May 24, 2024

Do you have in mind making another variant of Value or extending Number?

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

No branches or pull requests

3 participants