Post Reply 
Reductions fractions.
11-28-2017, 09:47 PM (This post was last modified: 11-28-2017 10:12 PM by StephenG1CMZ.)
Post: #13
RE: Reductions fractions.
(11-28-2017 07:03 PM)ggauny@live.fr Wrote:  Hi,

I see a little thing I no understand, sometime there is decimal
instead of integer.

I give example in attachement. Even I try mani things it is no change.

It is not important you know.

This gets rid of the unwanted real:
Code:

EXPORT TRYG()
BEGIN 
 LOCAL LL={5/9,7/4,6/11};
 LOCAL DD:=1/gcd(exact(LL));
 LOCAL NN:=LL*DD;
 
 RETURN {approx(DD),NN};// numerators or
 RETURN {approx(DD),exact(NN/DD)}; // fractions
END;
But the fractions are not nice: x/1/1/396 instead of x/396.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Reductions fractions. - ggauny@live.fr - 11-28-2017, 11:31 AM
RE: Reductions fractions. - Carlos295pz - 11-28-2017, 02:18 PM
RE: Reductions fractions. - DrD - 11-28-2017, 02:23 PM
RE: Reductions fractions. - Carlos295pz - 11-28-2017, 03:38 PM
RE: Reductions fractions. - chromos - 11-28-2017, 07:54 PM
RE: Reductions fractions. - ggauny@live.fr - 11-28-2017, 03:06 PM
RE: Reductions fractions. - ggauny@live.fr - 11-28-2017, 03:46 PM
RE: Reductions fractions. - Carlos295pz - 11-28-2017, 03:52 PM
RE: Reductions fractions. - ggauny@live.fr - 11-28-2017, 04:12 PM
RE: Reductions fractions. - ggauny@live.fr - 11-28-2017, 04:56 PM
RE: Reductions fractions. - ggauny@live.fr - 11-28-2017, 07:03 PM
RE: Reductions fractions. - StephenG1CMZ - 11-28-2017 09:47 PM
RE: Reductions fractions. - ggauny@live.fr - 11-29-2017, 09:17 AM
RE: Reductions fractions. - ggauny@live.fr - 11-29-2017, 03:13 PM
RE: Reductions fractions. - Carlos295pz - 11-29-2017, 03:35 PM



User(s) browsing this thread: 2 Guest(s)