Logo
Reference manual - version qle_version
nettedcommoditycashflow.hpp File Reference

Cash flow that nets multiple commodity floating leg cashflows for a given payment period. More...

#include <ql/patterns/visitor.hpp>
#include <qle/cashflows/commoditycashflow.hpp>
#include <vector>

Classes

class  NettedCommodityCashFlow

Functions

QuantLib::Real roundWithPrecision (QuantLib::Real value, QuantLib::Natural precision, QuantLib::Natural preRoundPrecision=8)
 Helper function to perform precise rounding with pre-rounding to avoid floating point issues.

Detailed Description

Cash flow that nets multiple commodity floating leg cashflows for a given payment period.

Function Documentation

◆ roundWithPrecision()

QuantLib::Real roundWithPrecision ( QuantLib::Real value,
QuantLib::Natural precision,
QuantLib::Natural preRoundPrecision = 8 )

Helper function to perform precise rounding with pre-rounding to avoid floating point issues.

Parameters
valueThe value to round
precisionNumber of decimal places for final rounding
preRoundPrecisionNumber of decimal places for pre-rounding (default 8)
Returns
The rounded value