` [n,d]=rat(a)`

` [n,d]=rat(a, tol)`

Inputs | |

`a` |
An array of real numbers. |

`tol` |
The desired accuracy of the approximation. Must be a small non-zero positive number. |

Outputs | |

`n` |
The integer numerators of the rational approximation. |

`d` |
The integer denominators of the rational approximation. |

>>(n,d)=rat([pi,exp(1)])>>n355 1457>>d113 536