Problem getting a rational result from "float2rational()"

Bugs

Modérateur : xcasadmin

radwillaims
Messages : 6
Inscription : lun. mars 07, 2011 2:03 pm

Problem getting a rational result from "float2rational()"

Message par radwillaims » mer. avr. 25, 2012 12:43 am

I'm not sure if I'm doing something wrong or if this is a bug. I did a search of this thread and did not see anything under "float2rational. I'm using Google Translate because English (USA) is my native language. I am trying to use the command float2rational and I can't seem to get it to display a rational result. I have tried with "xcas 0.9.5 (c) 2000-8, Bernard Parisse, Renee De Graeve" on linux and on Windows XP. I'm trying to use float2rational as I would use "XQ" on the HP50g.

Thank you, Ronald Williams

parisse
Messages : 5881
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Problem getting a rational result from "float2rational()"

Message par parisse » mer. avr. 25, 2012 8:32 am

I just tried the example of the online short help float2rational(1.5) returns the rational 3/2. Can you give an example of input where you get an unexpected answer?

radwillaims
Messages : 6
Inscription : lun. mars 07, 2011 2:03 pm

Re: Problem getting a rational result from "float2rational()"

Message par radwillaims » mer. avr. 25, 2012 9:38 am

I have just tried the same example without success. I attached a window capture so you can better see what I am doing wrong.

Thank you, Ronald Williams
Pièces jointes
XCAS float2rational example.jpg
XCAS float2rational example.jpg (97.37 Kio) Consulté 5311 fois

parisse
Messages : 5881
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Problem getting a rational result from "float2rational()"

Message par parisse » mer. avr. 25, 2012 11:19 am

Ok, it's the precision, go back to Digits:=12 and you will get the answer, float2rational does not convert multi-precision floats currently, only hardware floats, I guess we need to fix that.

radwillaims
Messages : 6
Inscription : lun. mars 07, 2011 2:03 pm

Re: Problem getting a rational result from "float2rational()"

Message par radwillaims » mer. avr. 25, 2012 11:49 pm

Thank you for the work around. I'm glad I sent the screen print. It seemed to pinpoint the problem.

I really like Xcas. I find it a natural extension of the HP 49/50 cas functionally. Many thanks go to you and your team for developing and sharing these wonderful tools.

Ronald Williams

Répondre