The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Static Public Member Functions | List of all members
floating_point_emulation::detail::tscale< T, 0 > Struct Template Reference

#include <floating_point_emulation.hpp>

Static Public Member Functions

static T down (T &value)
 Scales the internal value up. More...
 
static T up (T &value)
 Scales the value up. More...
 

Detailed Description

template<class T>
struct floating_point_emulation::detail::tscale< T, 0 >

Definition at line 155 of file floating_point_emulation.hpp.

Member Function Documentation

template<class T >
static T floating_point_emulation::detail::tscale< T, 0 >::down ( T &  value)
inlinestatic

Scales the internal value up.

Upscaling is used for:

  • Returning the value to external code; the internal representation needs to be adjusted for the external representation.
  • After multiplying a tfloat, then both values were scaled so the value is a factor tfloat::scale_factor too big.

Definition at line 167 of file floating_point_emulation.hpp.

template<class T >
static T floating_point_emulation::detail::tscale< T, 0 >::up ( T &  value)
inlinestatic

Scales the value up.

Upscaling is used for:

  • Loading the value it needs to be scaled to the internal value.
  • After dividing a tfloat, then both values were scaled so the value is a factor tfloat::scale_factor too small.

Definition at line 181 of file floating_point_emulation.hpp.


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