How To:
|
(Tested in Mobius 09/18/2018) Suppose you have a fraction and want to access the numerator and denominator. Mobius does not seem to have such a function.
Before going any further, note that you need to have an actual fraction. In particular defing a value like : $X=5/7 will NOT allow you to extract the numerator and denominator, because Mobius immediately converts this to a decimal number. You need to define your fraction using frac or by a Maple call:$X=frac(5,7); Maple DOES have functions to do this for you, they are denom and numer. To get the denominator and numerator of $X from Maple use the calls: $DenX = maple("denom($X)"); or if you want just one Maple call:
$Temp=maple("denom($X),numer($X)");
You can save on Maple calls as follows. Suppose $X is our rational. The following code will get the denominator and numerator for you: $DenX=sqrt(1/($X/$X)); Yes, that is ($X/$X)! You MUST use the brackets as shown, it does not
work otherwise.
|
How-To Index | Updated: 09/18/2018 SMS/MUO |