Aligns the value to the next specified boundary.
Namespace: SharpAssembler.CoreAssembly: SharpAssembler Core (in SharpAssembler Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# |
|---|
public static Int128 Align( Int128 value, int boundary ) |
| Visual Basic |
|---|
Public Shared Function Align ( _ value As Int128, _ boundary As Integer _ ) As Int128 |
| Visual C++ |
|---|
public: static Int128 Align( Int128 value, int boundary ) |
Parameters
- value
- Type: SharpAssembler.Core..::..Int128
The value to align.
- boundary
- Type: System..::..Int32
The boundary, which is a power of two.
Return Value
The aligned value.
Exceptions
| Exception | Condition |
|---|---|
| System..::..ArgumentOutOfRangeException | boundary < 1 |
| System..::..ArgumentException | !(IsPowerOfTwo(boundary)) |
Contracts
This method is pure.
| Requires | ||
|---|---|---|
boundary >= 1
| ||
IsPowerOfTwo(boundary)
|
| Ensures |
|---|
Contract.Result<Int128>() >= value |