Division by zero in rat/rats

John W. Eaton jwe at bevo.che.wisc.edu
Wed Jun 11 13:25:26 CDT 2008


On 11-Jun-2008, Atanas Atanasov wrote:

| Bug report for Octave 3.0.0 configured for x86_64-pc-linux-gnu
| 
| Description:
| -----------
| 
| The functions rat and rats should handle the special case of zero  
| input, which it seems currently they do not do. As a result the user  
| recieves a 'warning: division by zero' and wrong output.
| 
| Repeat-By:
| ---------
| 
| rat(0)
| [p,q] = rat(0)
| rats(0)
| 
| Fix:
| ---
| 
| It is possible to check whether the input is zero before calling  
| rat/rats but this is tedious. The check should be incorporated in the  
| beginning of rat.m.

Please try the following patch.

jwe


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080611/6d0580a2/attachment.ksh 


More information about the Bug-octave mailing list