Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Re: TSE: Floating: Point: Calculations: DLL: tsemathscientificcalculator.s

34 views
Skip to first unread message

knud van eeden

unread,
Jan 13, 2025, 10:26:18 AMJan 13
to SemWare TSE Pro Text Editor, S.E. Mitchell
TSE: Floating: Point: Calculations: DLL: tsemathscientificcalculator.s

Hello,

1. Note: If this program shows its usefulness I would propose to maybe add the .dll
to a new directory '<TSE>\math' and to add the .s file to the 'potpourri' menu
in TSE and to publish this in e.g. the next release of TSE.

2. This will add floating point to TSE.

3. If any issues seen, please let me know.

4. Here a TSE program 
(based fully on original earlier source code of Rick Hodgin,
but I used Claude AI + DeepSeek to add more functionality
to it.

5. Including a full parser of mathematical expression input.

Examples:

 2 * sin( 1 ) = 1.68294191

 2^3^4 = 64

 -3 * -4 = 12 

 sin( 1 ) * cos( 1 ) * sinh( 2 ) * cosh( 1 ) = 2.54445863

6. Optionally: To double check the result you can e.g. copy/paste the expression also to (Google) browser addres bar.

7. Implemented functions e.g.:

+, -, *, /, ^, abs, ceiling, cos, cosh, exp, floor, log, log10, mod, rad2deg, sin, sinh, sqrt, tan, tanh, e, pi, log10

Steps:

1. Download the tsemathscientificcalculator.zip file

    https://knudvaneeden.com/temp/tsemathscientificcalculator.zip

2. Unzip the file somewhere

3. Put both 

    tsemathscientificcalculator.

   and 
  
    tsemathscientificcalculator.dll file 

in the *same* directory.

4. Compile tsemathscientificcalculator.s in that same directory

5. Run the tsemathscientificcalculator.mac in that same directory

Note: Optionally: the tsemathscientificcalculator.c file could be compiled
by using Borland C++ command line compiler version 5.5 using

 bcc32.exe -tWD -I<pathtoyourborlandincludedirectory> -L<pathtoyourborlandlibdirectory> tsemathscientific.c

and that will then create the tsemathscientificcalculator.dll

with friendly greetings
Knud van Eeden



knud van eeden

unread,
Jan 13, 2025, 1:10:47 PMJan 13
to SemWare TSE Pro Text Editor, S.E. Mitchell
1. Additional functions: asin, acos, atan (which give the inverse value of a given sin, cos and tan).

2. In case of always download the latest version first, as things change:

    https://knudvaneeden.com/temp/tsemathscientificcalculator.zip

3. Of course you can now additionally add your (basically any) (scientific) floating point calculations to your TSE programs by including the necessary information (DLL, ...)

4. Now TSE has floating point 
(similar to e.g. editors like SlickEdit who has this floating point ability already long since).

5. Note: In case of incorporating tsemathscientificcalculator.dll in TSE it can also be put in the TSE main directory, similar to e.g. 'spell.dll' there. 

6. Note: It is a (very) small DLL, something like 35K file size.

Carlo Hogeveen

unread,
Jan 17, 2025, 7:27:49 AMJan 17
to sem...@googlegroups.com

 

Let me know if anyone wants math/float functions in TSE that are implemented using the macro language instead of an external DLL.

They would be much slower than Knud’s solution, but can be made as flexible as required.

I have been looking into it a bit and find it fascinating, but I have no practical use cases for such functionality.

 

Carlo

 

 

H P

unread,
Jan 17, 2025, 11:19:45 AMJan 17
to sem...@googlegroups.com
Carlo, 
It may be slower but you will be able to also use it on linux.


Met vriendelijke groet,
With kind regards,
Muy atentamente,
Mit Freundliche Gruß,
Sinceramente,


H. Pikaar

Henri...@gmail.com



Op vr 17 jan 2025 om 13:27 schreef Carlo Hogeveen <t...@ecarlo.nl>:
--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/002201db68db%2436d1b080%24a4751180%24%40ecarlo.nl.

Carlo Hogeveen

unread,
Jan 17, 2025, 11:47:48 AMJan 17
to sem...@googlegroups.com

Excellent point!
Other features could be numbers with an extreme amount of digits and not-rounded rational numbers.
That said, so far my idea seems to be a solution in search of a problem.

Carlo



From: sem...@googlegroups.com <sem...@googlegroups.com> On Behalf Of H P
Sent: Friday, January 17, 2025 5:20 PM
To: sem...@googlegroups.com
Subject: Re: [TSE] Re: TSE: Floating: Point: Calculations: DLL: tsemathscientificcalculator.s

Carlo,
It may be slower but you will be able to also use it on linux.



Met vriendelijke groet,
With kind regards,
Muy atentamente,
Mit Freundliche Gruß,
Sinceramente,


H. Pikaar
mailto:Henri...@gmail.com


Op vr 17 jan 2025 om 13:27 schreef Carlo Hogeveen <mailto:t...@ecarlo.nl>:

Let me know if anyone wants math/float functions in TSE that are implemented using the macro language instead of an external DLL.
They would be much slower than Knud’s solution, but can be made as flexible as required.
I have been looking into it a bit and find it fascinating, but I have no practical use cases for such functionality.

Carlo


--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/002201db68db%2436d1b080%24a4751180%24%40ecarlo.nl?utm_medium=email&utm_source=footer.
--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/CAAR3jqFyfn9nR3etE7pXw7VkfaOO2Vi4%2BZpXYm2g1g69ERZqWg%40mail.gmail.com?utm_medium=email&utm_source=footer.

knud van eeden

unread,
Jan 17, 2025, 12:23:58 PMJan 17
to sem...@googlegroups.com
> Let me know if anyone wants math/float functions in TSE that are implemented using the macro language instead of an external DLL.

At the moment I do not believe that is possible.

One would have to develop all these functions like sine, cosine, tan, arcsine, arccos, arctan, e power, logarithm, ... 
and exceptions.

Maybe some operations like add, subtract, multiply, divide, ...
but still a very big major effort if ever ready assumed...

with friendly greetings
Knud van Eeden


knud van eeden

unread,
Jan 17, 2025, 12:27:17 PMJan 17
to sem...@googlegroups.com
> It may be slower but you will be able to also use it on linux.

At the moment I assume it would very possibly possible to recompile that C DLL to a Linux equivalent also
using gcc. That could maybe be done in a few minutes to few hours of experimenting.


knud van eeden

unread,
Jan 17, 2025, 12:31:27 PMJan 17
to sem...@googlegroups.com
I am pretty sure at this moment if I should ask Claude, DeepSeek or ChatGPT AI it will give me an answer in a minute
(=from Borland C++ version 5.5 command line compiler to gcc instead and a Linux DLL like answer (I know, you can
not use DLLs on Linux they have their own equivalent).



knud van eeden

unread,
Jan 17, 2025, 12:34:15 PMJan 17
to sem...@googlegroups.com
I realize now, the problem is that one can have such Linux DLL like solution, but we have no possibility in TSE built-in to use that in Linux as far as I know, so this conversion method Windows -> Linux is not going to work at all I assume at this moment. So will not be tried in the current state of TSE.

knud van eeden

unread,
Jan 17, 2025, 12:41:20 PMJan 17
to sem...@googlegroups.com
So on Linux one would use the external executable like

 zzcalc 

developed by 

Zhong Zhao.

Or one similar solution created by me later some day.

Sent from Yahoo Mail on Samsung Galaxy S24 Ultra / 1 terabyte / artificial intelligence

On Fri, Jan 17, 2025 at 18:34, knud van eeden

knud van eeden

unread,
Jan 17, 2025, 1:03:28 PMJan 17
to sem...@googlegroups.com
What I plan to do is to ask Grok, Claude, DeepSeek, Gemini, ChatGPT, Perplexity, QWen, ... AI to create a floating point TSE SAL add function and e.g. floating point TSE SAL sine function and if that works extend it to many more similar functions. 


Sent from Yahoo Mail on Samsung Galaxy S24 Ultra / 1 terabyte / artificial intelligence

Carlo Hogeveen

unread,
Jan 17, 2025, 1:17:49 PMJan 17
to sem...@googlegroups.com

> One would have to develop all these functions like sine, cosine, tan, arcsine, arccos, arctan, e power, logarithm, ...

Well, only the ones that are needed and asked-for, but yes, that could be all of the above and more.


> but still a very big major effort if ever ready assumed...

Nah.
I read your "ready" reference as referring to writing the macro.
That would actually be exceptionally easy.
All these functions have finite algorithms, where finite is determined by the required precision.
For example, the sine and cosine functions can be calculated using a Taylor series,
and the other circle/wave-functions are derivatives of these two functions.
Most of my macro-writing time is spent on anticipating user interaction,
and I am beginning to develop a love/hate relationship with configuration menus.
There will be no configuration menu for a math macro!
This would be sooo easy :-)

The macro's weak point would be calculating the sine for 10,000 angles each consisting of 10,000 digits.
Its run-time might be longer than it would take me to write the macro. :-)

Which brings me back to there currently being no practical use case for such a macro.

Carlo



From: 'knud van eeden' via SemWare TSE Pro text editor <sem...@googlegroups.com>
Sent: Friday, January 17, 2025 6:24 PM
To: sem...@googlegroups.com
Subject: Re: [TSE] Re: TSE: Floating: Point: Calculations: DLL: tsemathscientificcalculator.s

> Let me know if anyone wants math/float functions in TSE that are implemented using the macro language instead of an external DLL.

At the moment I do not believe that is possible.

One would have to develop all these functions like sine, cosine, tan, arcsine, arccos, arctan, e power, logarithm, ...
and exceptions.

Maybe some operations like add, subtract, multiply, divide, ...
but still a very big major effort if ever ready assumed...

with friendly greetings
Knud van Eeden


On Friday, January 17, 2025 at 05:19:54 PM GMT+1, H P <mailto:henri...@gmail.com> wrote:


Carlo,
It may be slower but you will be able to also use it on linux.



Met vriendelijke groet,
With kind regards,
Muy atentamente,
Mit Freundliche Gruß,
Sinceramente,


H. Pikaar
mailto:Henri...@gmail.com


Op vr 17 jan 2025 om 13:27 schreef Carlo Hogeveen <mailto:t...@ecarlo.nl>:

Let me know if anyone wants math/float functions in TSE that are implemented using the macro language instead of an external DLL.
They would be much slower than Knud’s solution, but can be made as flexible as required.
I have been looking into it a bit and find it fascinating, but I have no practical use cases for such functionality.

Carlo


--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/002201db68db%2436d1b080%24a4751180%24%40ecarlo.nl?utm_medium=email&utm_source=footer.
--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/CAAR3jqFyfn9nR3etE7pXw7VkfaOO2Vi4%2BZpXYm2g1g69ERZqWg%40mail.gmail.com?utm_medium=email&utm_source=footer.
--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/1973046571.1285289.1737134630569%40mail.yahoo.com?utm_medium=email&utm_source=footer.

Knud van Eeden

unread,
Jan 17, 2025, 4:21:00 PMJan 17
to sem...@googlegroups.com
> For example, the sine and cosine functions can be calculated using a Taylor series,
> and the other circle/wave-functions are derivatives of these two functions.

Very good point, that is what I kind of knew about it at this moment also without having looked into it further.

But ...

Taylor is all about derivatives, first, second, third, ... derivative.

So those values would have to be calculated somehow first (probably some combination of floating point add, subtract, multiply, divide, ..., maybe power)

===

> Most of my macro-writing time is spent on anticipating user interaction,
> and I am beginning to develop a love/hate relationship with configuration menus.
> There will be no configuration menu for a math macro!
> This would be sooo easy   :-)

What is needed is thus an expression evaluator. E.g. you input something like

"3 * sin( 3.1415 / 2 ) - 2^3 + 5 / 6"

I have such in my tsemathscientificcalculator.s and also Zhong Zhao has it in his 'zzcalc.s' (='Z'hong'Z'hao'CALCulator.s).

But mine does still have some issues (e.g. 0^0, 0^(1/2), ... so gives wrong answers in special cases, ... (thus errors as far as I know), so that will have to be improved further some time).




To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/004001db690c%241af85d10%2450e91730%24%40ecarlo.nl.

Knud van Eeden

unread,
Jan 17, 2025, 4:36:18 PMJan 17
to sem...@googlegroups.com
> What is needed is thus an expression evaluator

The simplest solution for this is 'Dijkstra's double priority' algorithm.
You create a table with 2 priorities per operator (priorities you choose so that e.g. '*' has higher priority than '+' and so on...).
Your given infix expression you parse, put the operators and the operands on a stack and convert to a postfix (RPN) expression.
The resulting stack you then parse from top to bottom and pull the operators and operands from it using that defined double priority.


knud van eeden

unread,
Jan 20, 2025, 9:15:09 AMJan 20
to sem...@googlegroups.com
Here is a significant example of where applicable using a TSE SAL floating point implementation:



See also already created solutions in TSE SAL by me:



with friendly greetings
Knud van Eeden


--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion visit
Reply all
Reply to author
Forward
0 new messages