Skip to content

Composing quantities for output #8

@kwikius

Description

@kwikius

Ultimately stream output is not the concern of the library in general. It is up to the programmer, but for use in examples etc, there needs to be an output scheme, and that can be used to provide some ideas for users own output schemes

For SI output there is some loose guidance
https://www.nist.gov/pml/special-publication-811/nist-guide-si-chapter-6-rules-and-style-conventions-printing-and-using
so there probably needs to be a default output that conforms to those guidelines

6.1.5 Unit symbols obtained by multiplication
6.1.6 Unit symbols obtained by division

Activities associated with composing SI stream output.
naming
multiplication
division
pow

simple grammar

expression :
prim |
multiplicative_expression

prim:
named_quantity |
( expression ) |
pow<N,D>( expression )

multiplicative_expression :

prim * multiplicative_expression |
prim / multiplicative_expression

Composition is done at the level of units, not quantities, otherwise quantities template size will increase in complexity according to the expression in source code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions