Table of Contents

Method ClampMeasure

Namespace
DocWright.Core.Primitives
Assembly
DocWright.Core.dll

ClampMeasure(long)

Clamps a raw measure to MaxMeasure, so that downstream checked arithmetic on the result cannot overflow.

public static Twips ClampMeasure(long twips)

Parameters

twips long

The raw measure, in twips, before clamping.

Returns

Twips

The clamped length.

ClampMeasure(double)

Clamps a raw measure expressed as a real number to MaxMeasure, rounding half away from zero. Non-finite input clamps to the corresponding bound, or to Zero for NaN.

public static Twips ClampMeasure(double twips)

Parameters

twips double

The raw measure, in twips, before clamping.

Returns

Twips

The clamped length.