NonNegativeInterval

scalus.cardano.ledger.NonNegativeInterval
See theNonNegativeInterval companion class

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(numerator: Long, denominator: Long): NonNegativeInterval
def apply(numerator: Long): NonNegativeInterval
def apply(value: Double, precision: Int = ...): NonNegativeInterval

Creates a NonNegativeInterval from a double value. Uses a precision of 1,000,000 for the conversion.

Creates a NonNegativeInterval from a double value. Uses a precision of 1,000,000 for the conversion.

Value parameters

value

A non-negative double

Attributes

Returns

The corresponding NonNegativeInterval

def reduce(numerator: Long, denominator: Long): NonNegativeInterval
def reduceBigInt(numerator: BigInt, denominator: BigInt): NonNegativeInterval

Reduces a fraction represented as BigInts to a NonNegativeInterval. This version handles values that may overflow Long during intermediate calculations.

Reduces a fraction represented as BigInts to a NonNegativeInterval. This version handles values that may overflow Long during intermediate calculations.

Value parameters

denominator

The denominator as BigInt (must be positive)

numerator

The numerator as BigInt

Attributes

Returns

A reduced NonNegativeInterval

Throws
IllegalArgumentException

if the reduced values don't fit in Long

def unapply(x: NonNegativeInterval): Option[(Long, Long)]

Concrete fields

Givens

Givens

CBOR Decoder for NonNegativeInterval. Decodes from a tagged array [numerator, denominator] with tag 30.

CBOR Decoder for NonNegativeInterval. Decodes from a tagged array [numerator, denominator] with tag 30.

Attributes

CBOR Encoder for NonNegativeInterval. Encodes as a tagged array [numerator, denominator] with tag 30.

CBOR Encoder for NonNegativeInterval. Encodes as a tagged array [numerator, denominator] with tag 30.

Attributes

FromData instance for NonNegativeInterval. Decodes from array [numerator, denominator] in Plutus Data. Note: The tag (30) is NOT included in the Plutus Data representation, only the array structure.

FromData instance for NonNegativeInterval. Decodes from array [numerator, denominator] in Plutus Data. Note: The tag (30) is NOT included in the Plutus Data representation, only the array structure.

Attributes

ToData instance for NonNegativeInterval. Encodes as array [numerator, denominator] in Plutus Data. Note: The tag (30) is NOT included in the Plutus Data representation, only the array structure.

ToData instance for NonNegativeInterval. Encodes as array [numerator, denominator] in Plutus Data. Note: The tag (30) is NOT included in the Plutus Data representation, only the array structure.

Attributes