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