Try..

` ``setMode("Exact/Approx","EXACT") string(frac)&"/1"→str inString(str,"/")→pos expr(left(str,pos-1))→num expr(right(str,pos+1))→denom`

` ``expr(right(str,pos2+1))→denom`

Also, the code works with the current `expr(right(str,pos2))→denom`, adding one would increase the value of the denominator, which would be inaccurate, and putting the one inside the `right()` command yields a syntax error.

And I never realized that there were commands that separate the numerator and denominator. Like I said, I always make overly complicated programs :)

]]>Suggest..

` ``string(frac)&"/1"→str`

..to avoid Domain Error when handling fractions that resolve to whole numbers e.g 3/1, 16/16.. code will return Denom of 1.

Last three lines could be boiled down to 2 and no need for variables, but will leave that for now as I see OP has found in-built functions to the job a whole lot better:)

]]>+1 on TO DO:

tibasicdev•wikidot•com/68k:getdenom

tibasicdev•wikidot•com/68k:getnum

I have a similar requirement to extract powers from expressions like 2^{2}.5^{5}. Squid's code could be modified to yield those, but is there built in functions to do this also? Will start a new thread if no answers here..

` ``2/3→frac getNum(frac) © 2 getDenom(frac) © 3`

Wiki pages please? I honestly don't know how to fill out the command template.

]]>` ``setMode("Exact/Approx","EXACT") string(frac)&"/1"→str inString(str,"/")→pos dim(str)-pos→pos2 expr(mid(str,1,pos-1))→num expr(right(str,pos2))→denom`