Inline division

Inline division - Сообщения

#1 Опубликовано: 15.12.2021 23:52:35
Chito

Chito

1 сообщений из 6 понравились пользователям.

Группа: User

Is there any way to present division on the same line and not as a fraction? For example in Mathcad:
smath-division.png
#2 Опубликовано: 16.12.2021 08:51:57
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Is there any way to present division on the same line and not as a fraction ?



Maths Infix DIVIDE.sm (4 КиБ) скачан 32 раз(а).

Infix DIVIDE.PNG

1 пользователям понравился этот пост
sergio 16.12.2021 09:19:00
#3 Опубликовано: 16.12.2021 10:48:27
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

AlgoDivide.PNG
#4 Опубликовано: 16.12.2021 11:12:28
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

If you don't need strictly a division symbol, you can use a multiplication

2021-12-16 15_10_51-SMath Solver - [Worksheet1_].png

If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#5 Опубликовано: 17.06.2022 15:33:17
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

74 сообщений из 164 понравились пользователям.

Группа: User

Greetings!

Wrote

...division on the same line...



It is possible to combine Davide's and Jean's solutions, but you need to pull off a few tricks:
   1) Create a custom function with (1) parameter
   2) Use the special inline division character 「÷」
   3) Declare your custom function as a 'unit' (this suppress the multiplication operation from displaying)

To create the custom function with the inline division character, copy and paste the following into your SMath Worksheet:
'÷(_denom):1/_denom

To utilize it, type in your numerator and multiply it by the custom function, where you pass the denominator into the function as the parameter.

EXAMPLE: solving for 6/2; copy and paste the following (NOTE: since I am declaring the custom function as a unit; you must include ' when calling the custom function):
6*'÷(2)=#@#




-Kenny Lemens, P.E.
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
3 пользователям понравился этот пост
sergio 17.06.2022 17:33:00, Chito 20.06.2022 03:27:00, Oscar Campo 21.06.2022 08:24:00
#6 Опубликовано: 24.06.2022 17:10:31
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

74 сообщений из 164 понравились пользователям.

Группа: User

Greetings,

If you just need the statement to be on the same line and you want to avoid the use of exponents and custom functions, there is a native solution:

Use the function str2num(▮) and type your statement as a string:

     SMath_inlineDivision.jpg

You do have the ability to reference variables, but the use of whitespace (tab, space, newline, etc.) will corrupt the string and str2num(▮) will throw an error.

Thus this statement will work:
     str2num("(2+22)/4")=6

But this statement will throw a 'not defined' error:
     str2num("(2 + 22) / 4")=▮


Its a good day to be alive;
-Kenny Lemens, P.E.
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
#7 Опубликовано: 24.06.2022 19:12:53
overlord

overlord

552 сообщений из 1332 понравились пользователям.

Группа: Moderator

In addition to Kenny you can remove white spaces.
Furthermore, you can define a nameless function with Ctrl+Shift+K.
It won't show a function before it, though it is a function.
By that your statement shall look as a "normal" calculation.

Regards

str2num.sm (2 КиБ) скачан 22 раз(а).

2022-06-25_01-08.png
#8 Опубликовано: 24.06.2022 21:55:13
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Is there any way to present division on the same line and not as a fraction ?


Answer is NO, Smath does not have native ÷ operator
More productive from infix algo style utilities,
for infinite in-situ command line.

infix Divide.sm (3 КиБ) скачан 23 раз(а).

#9 Опубликовано: 24.06.2022 23:12:52
overlord

overlord

552 сообщений из 1332 понравились пользователям.

Группа: Moderator

Answer is YES, there are multiple ways demonstrated above. Choose what suits you most.
1 пользователям понравился этот пост
⚜ Kenny Lemens, P.E. ᵂᴵ 06.06.2024 03:24:00
#10 Опубликовано: 25.06.2022 14:43:46
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Oterwise.PNG
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений