Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline chito  
#1 Posted : 16 December 2021 05:52:35(UTC)
chito

Rank: Newbie

Groups: Registered
Joined: 10/12/2021(UTC)
Posts: 6
Philippines

Was thanked: 1 time(s) in 1 post(s)
Is there any way to present division on the same line and not as a fraction? For example in Mathcad:
smath-division.png

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 16 December 2021 14:51:57(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: chito Go to Quoted Post
Is there any way to present division on the same line and not as a fraction ?


Maths Infix DIVIDE.sm (5kb) downloaded 11 time(s).

Infix DIVIDE.PNG

thanks 1 user thanked Jean Giraud for this useful post.
on 16/12/2021(UTC)
Offline Jean Giraud  
#3 Posted : 16 December 2021 16:48:27(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
AlgoDivide.PNG
Offline Davide Carpi  
#4 Posted : 16 December 2021 17:12:28(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
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 consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Kenny Lemens  
#5 Posted : 17 June 2022 21:33:17(UTC)
Kenny Lemens


Rank: Advanced Member

Groups: Registered
Joined: 11/01/2018(UTC)
Posts: 131
Man
United States
Location: Wisconsin

Was thanked: 58 time(s) in 37 post(s)
Greetings!

Originally Posted by: chito Go to Quoted Post
...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:
Code:
'÷(_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):
Code:
6*'÷(2)=#@#





-Kenny Lemens, P.E.

Edited by user 17 June 2022 21:38:17(UTC)  | Reason: Spelling Errors (Noted in Orange)

"No matter where you go, there you are." -Buckaroo Banzai

Hotkeys: https://en.smath.com/for...rce.ashx?a=45771&b=2
thanks 3 users thanked Kenny Lemens for this useful post.
on 17/06/2022(UTC),  on 20/06/2022(UTC),  on 21/06/2022(UTC)
Offline Kenny Lemens  
#6 Posted : 24 June 2022 23:10:31(UTC)
Kenny Lemens


Rank: Advanced Member

Groups: Registered
Joined: 11/01/2018(UTC)
Posts: 131
Man
United States
Location: Wisconsin

Was thanked: 58 time(s) in 37 post(s)
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 Banzai

Hotkeys: https://en.smath.com/for...rce.ashx?a=45771&b=2
Offline overlord  
#7 Posted : 25 June 2022 01:12:53(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,124
Turkey

Was thanked: 506 time(s) in 337 post(s)
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 (3kb) downloaded 3 time(s).

2022-06-25_01-08.png
Offline Jean Giraud  
#8 Posted : 25 June 2022 03:55:13(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: chito Go to Quoted Post
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 (4kb) downloaded 5 time(s).

Offline overlord  
#9 Posted : 25 June 2022 05:12:52(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,124
Turkey

Was thanked: 506 time(s) in 337 post(s)
Answer is YES, there are multiple ways demonstrated above. Choose what suits you most.
Offline Jean Giraud  
#10 Posted : 25 June 2022 20:43:46(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Oterwise.PNG
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.