better.subtraction: Calculates the smallest distance between two modular numbers

View source: R/better_subtraction.R

better.subtractionR Documentation

Calculates the smallest distance between two modular numbers

Description

This function takes the difference b-a and returns the signed difference with the smallest absolute value in modulus base. The function will compute b mod base and a mod base before subtracting.

Usage

better.subtraction(diff, base = 2 * pi)

Arguments

diff

difference: (b mod base)-(a mod base)

base

base of the modulus numbers a and b.

Value

signed difference of b and a with the smallest possible absolute value in modulus base


AlreadyTakenJonas/RHotStuff documentation built on Oct. 28, 2022, 10:15 p.m.