# roundMatrix -- lifts matrix over RR to matrix over QQ

## Synopsis

• Usage:
roundMatrix(n, A)
• Inputs:
• A, , with real entries
• n, an integer, a threshold for rounding digits
• Outputs:
• , a matrix over QQ, obtained by rounding entries of A

## Description

This method converts a real matrix to a rational matrix, by rounding each entry. The input $n$ specifies the number of (decimal) digits used for rounding.

 i1 : A = matrix{{1, 2.5, -13/17}, {2*pi, 4.7, sqrt(2)}} o1 = | 1 2.5 -.764706 | | 6.28319 4.7 1.41421 | 2 3 o1 : Matrix RR <--- RR 53 53 i2 : roundMatrix(5, A) o2 = | 1 5/2 -76471/100000 | | 628319/100000 47/10 141421/100000 | 2 3 o2 : Matrix QQ <--- QQ