# ApCoCoA-1:Fn.ReduceModPi

From ApCoCoAWiki

Revision as of 09:27, 4 May 2011 by S schuster (talk | contribs) (New page: <command> <title>Fn.ReduceModPi</title> <short_description>Reduces a given value modulo 2*pi to the interval between -pi and pi.</short_description> <syntax> Fn.ReduceModPi(Val:RAT,Acc...)

## Fn.ReduceModPi

Reduces a given value modulo 2*pi to the interval between -pi and pi.

### Syntax

Fn.ReduceModPi(Val:RAT,Acc:INT):RAT

### Description

This function reduces `Val` modulo 2*pi to the interval

`(-pi, pi)` 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 Returns a pair

`[R, Q]`such that`Val = Q*2*pi + R`where`Q`is an integer and`R`is between -pi and pi.

#### Example

Dec(Fn.ReduceModPi(10^20, 10), 20) ; [-0.7013521577, 15915494309189533577] -------------------------------