Code covered by the BSD License  

Highlights from
RECI:Calculates the reciprocal of a number with desired accuracy

1.5

1.5 | 2 ratings Rate this file 2 Downloads (last 30 days) File Size: 1.49 KB File ID: #8519

RECI:Calculates the reciprocal of a number with desired accuracy

by Divakar Roy

 

21 Sep 2005 (Updated 23 Sep 2005)

Reciprocal calculation giving answer with as much decimal digits as is wished.

| Watch this File

File Information
Description

This function calculates the exact reciprocal of any number,with as much decimal digits as you wish.

Syntax:::::
reci(a,b)
where a is the number whose reciprocal is to be calculated and b is the max. no. of decimal digits you want in the answer

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
22 Sep 2005 Jos van der Geest

1) Does error when a <= 1
2) incorrect results for some values (e.g. 1.2)
3) Make it a function so the result is returned as a string

11 Oct 2005 Duane Hanselman

I can't understand the value of this function. When computing things numerically in double precision, why isn't 1/a sufficient? And how is 1/a represented in a way that is of value in MATLAB computations. If one gets a string result, why not just use vpa in the symbolic toolbox?

Please login to add a comment or rating.
Updates
23 Sep 2005

bugs pointed out by 'Jos van' are removed.

Tag Activity for this File
Tag Applied By Date/Time
reciprocal Divakar Roy 22 Oct 2008 08:00:23
division Divakar Roy 22 Oct 2008 08:00:23
show Divakar Roy 22 Oct 2008 08:00:23
decimal Divakar Roy 22 Oct 2008 08:00:23
digit Divakar Roy 22 Oct 2008 08:00:23

Contact us at files@mathworks.com