NonNegativeInterval

scalus.cardano.ledger.NonNegativeInterval
See theNonNegativeInterval companion class

Attributes

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

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

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

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