Unity: SimpleUnit Struct Reference

Unity 1.0 Parser for unit strings

- Main Page
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Data Fields

Data Fields
SimpleUnit Struct Reference

A simple unit, corresponding to, for example, ‘MHz’. More...

`#include <unity.h>`

Collaboration diagram for SimpleUnit:
[legend]

## Data Fields
char | base10_p
| True (non-zero) if the prefix is a power of 10; false if it's a power of 2.
const UnitDef * | base_unit_def
| The base unit of this unit specification, as a known unit.
char * | base_unit_string
| The base unit of this unit specification.
int | prefix_power
| The base-10 logarithm of the prefix in front of the unit.

## Detailed Description

A simple unit, corresponding to, for example, ‘MHz’.

## Field Documentation

const UnitDef* base_unit_def

The base unit of this unit specification, as a known unit.

If this is not a known unit (in the syntax which parsed the associated expression) then this will be NULL.

char* base_unit_string

The base unit of this unit specification.

This might be ‘m’ for metres, ‘Hz’ for Hertz, and so on.

int prefix_power

The base-10 logarithm of the prefix in front of the unit.

For example, this will be ‘-3’ for the ‘m’ (milli-) prefix.

The documentation for this struct was generated from the following file:

- unity.h

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines