🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Fluorite | Level 6

## why when i have decimals in the matrix I don't get the exact inverse? in SAS IML

I found the inverse and the transpose of a matrix. Now i want to check whether the matrix is orthogonal. The idea i used is to subtract the transpose and the inverse to get 0, but i found that the deference with some elements is 2.22 E-16. Although it is very small but i need to know why i don't get the exact 0.

I need help.

1 ACCEPTED SOLUTION

Accepted Solutions
Diamond | Level 26

## Re: why when i have decimals in the matrix I don't get the exact inverse? in SAS IML

This is called machine precision. Some floating point (or decimal) numbers can only be represented to within + or minus a small value epsilon, they cannot be represented exactly by a binary computer; and so this carries through the mathematical operations. Your result is essentially zero in the world of computers.

--
Paige Miller
2 REPLIES 2
Diamond | Level 26

## Re: why when i have decimals in the matrix I don't get the exact inverse? in SAS IML

This is called machine precision. Some floating point (or decimal) numbers can only be represented to within + or minus a small value epsilon, they cannot be represented exactly by a binary computer; and so this carries through the mathematical operations. Your result is essentially zero in the world of computers.

--
Paige Miller
Rhodochrosite | Level 12

## Re: why when i have decimals in the matrix I don't get the exact inverse? in SAS IML

@PaigeMiller is correct. The thing I would add is look at the proc compare documentation for various ways to compare computed numbers. Expecting differences to be zero for nontrivial (or ever some fairly trivial) computations is unrealistic. Also check out: https://documentation.sas.com/?docsetId=lrcon&docsetTarget=p0ji1unv6thm0dn1gp4t01a1u0g6.htm&docsetVe...

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
• 2 replies
• 384 views
• 0 likes
• 3 in conversation