converting strings to ratio

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

converting strings to ratio

harish3679
Hi guys,

I need to convert x =  5.1962 to ratio eg., x = 25981/5000. How does it work
in octave?

Thanks,
kev



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: converting strings to ratio

Andreas Weber-6
Am 06.10.19 um 20:22 schrieb harish3679:
> I need to convert x =  5.1962 to ratio eg., x = 25981/5000. How does it work
> in octave?

octave:> rats (5.1962)
ans =   821/158

HTH, Andy