ApCoCoA-1:Fn.ReduceModLn2

From ApCoCoAWiki
This article is about a function from ApCoCoA-1.

Fn.ReduceModLn2

Reduces a given value modulo the natural logarithm of 2.

Syntax

Fn.ReduceModLn2(Val:RAT,Acc:Int):LIST

Description

This function reduces Val modulo Ln(2) to the interval

[0, Ln(2)), thereby guaranteeing correctness of the result

up to the desired accuracy Acc.

  • @param Val The value to be reduced.

  • @param Acc The desired accuracy.

  • @return A pair [R, Q] such that Val = Ln(2)*Q + R where Q is an integer and R is between 0 and Ln(2) and rounded to accuracy Acc.

Example

Dec( Fn.ReduceModLn2(10^200, 300), 100);

[0.6180561092210337097642318484686251333232148266475695585717410024884378860227783295022403476737844868, 144269504088896340735992468100189213742664595415298593413544940693110921918118507988552662289350634449699751830965254425559310168716835964272066215822347933627453736988471849363070138766353201553389431]
-------------------------------

</types>

Fn.ReduceModPi

Fn.SetAccuracy

Fn.GetAccuracy