1 страниц (4 вхождений)
Variable Converted from Decimal to Fraction - Calculated variable shown as fraction when used in subsequent calculation - Сообщения
#1 Опубликовано: 14.01.2016 06:44:58
Hi all,
I define the variables a, b, and c and then use them in a calculation defining the variable x as follows:
a:=2
b:=3
c:=4
x:=a+b/c=2.75
And then I use the variable x in another calculation:
y:=a+b+x
If I use optimization "None" to show the values used in the calculation of y, SMath automatically converts x from decimal form to fraction.
I need it to show the decimal form of x as follows:
y=2+3+2.75
Instead of:
y=2+3+11/4
Does anyone know of a way to do this? Thanks for your help in advance.
I define the variables a, b, and c and then use them in a calculation defining the variable x as follows:
a:=2
b:=3
c:=4
x:=a+b/c=2.75
And then I use the variable x in another calculation:
y:=a+b+x
If I use optimization "None" to show the values used in the calculation of y, SMath automatically converts x from decimal form to fraction.
I need it to show the decimal form of x as follows:
y=2+3+2.75
Instead of:
y=2+3+11/4
Does anyone know of a way to do this? Thanks for your help in advance.
#2 Опубликовано: 14.01.2016 14:25:05
Just like this: press = after your equation.
There is nothing to "Optimze" the arithmetic
is between registers. You can have fraction
but fractions that don't terminate will need
be expressed in symbolic optimiz...
There is lot lot lot on that: keep posting.
Jean
Forum Help.sm (3 КиБ) скачан 36 раз(а).
There is nothing to "Optimze" the arithmetic
is between registers. You can have fraction
but fractions that don't terminate will need
be expressed in symbolic optimiz...
There is lot lot lot on that: keep posting.
Jean
Forum Help.sm (3 КиБ) скачан 36 раз(а).
#3 Опубликовано: 14.01.2016 15:56:37
#4 Опубликовано: 15.01.2016 00:06:22
Everyone,
Thank you for your replies. I may not have explained what I am looking for clearly. I am creating engineering calculations, and I need to show the values used in each step of the calculation so the work can be checked. In my example, I need to use optimization "None" to show the values used to calculate y, not just the result for y. My problem is that SMath is automatically converting the value for x to a fraction when it is used in the calculation for y. It is difficult to check the calculation if the result for x is shown in decimal form, and then is shown as a fraction when it is used in a subsequent step in the calculation. See below:
a:=2
b:=3
c:=4
x:=a+b/c
x=2.75 <--Here x is shown in decimal form
y:=a+b+x
y=2+3+11/4 <--I need to use optimization "None" to show the values used to calculate y, but x is automatically converted to 11/4 instead of being shown as 2.75
y=7.75
I need the calculation of y to show the decimal form of x so that someone else can check the calculation without having to convert 11/4 to 2.75 in their head.
The desired result is:
y:=a+b+x
y=2+3+2.75 <-- the value of x would be shown as 2.75 not 11/4
y=7.75
I hope this explains what I am looking for better. Thanks again for the replies.
Thank you for your replies. I may not have explained what I am looking for clearly. I am creating engineering calculations, and I need to show the values used in each step of the calculation so the work can be checked. In my example, I need to use optimization "None" to show the values used to calculate y, not just the result for y. My problem is that SMath is automatically converting the value for x to a fraction when it is used in the calculation for y. It is difficult to check the calculation if the result for x is shown in decimal form, and then is shown as a fraction when it is used in a subsequent step in the calculation. See below:
a:=2
b:=3
c:=4
x:=a+b/c
x=2.75 <--Here x is shown in decimal form
y:=a+b+x
y=2+3+11/4 <--I need to use optimization "None" to show the values used to calculate y, but x is automatically converted to 11/4 instead of being shown as 2.75
y=7.75
I need the calculation of y to show the decimal form of x so that someone else can check the calculation without having to convert 11/4 to 2.75 in their head.
The desired result is:
y:=a+b+x
y=2+3+2.75 <-- the value of x would be shown as 2.75 not 11/4
y=7.75
I hope this explains what I am looking for better. Thanks again for the replies.
1 страниц (4 вхождений)
-
Новые сообщения
-
Нет новых сообщений