Skip to content

Add support for many math functions (primarily C23 additions)#933

Open
JohnoKing wants to merge 1 commit intoksh93:devfrom
JohnoKing:4-c23math
Open

Add support for many math functions (primarily C23 additions)#933
JohnoKing wants to merge 1 commit intoksh93:devfrom
JohnoKing:4-c23math

Conversation

@JohnoKing
Copy link
Copy Markdown

src/cmd/ksh93/{data/math.tab,sh.1}:

  • Added support for 40 additional math functions from C23, TS 18661-1:2014, TS 18661-3:2015 and glibc.
  • Note that math function support varies depending on what the native math library actually has.

src/cmd/ksh93/include/streval.h:

  • Increase the char array to 18 bytes to fit the full name length for the newly added math functions.

src/cmd/ksh93/{data/math.tab,sh.1}:
- Add support for math functions from C23, TS 18661-1:2014,
  TS 18661-3:2015 and glibc.
- Note that math function support varies depending on what
  the native math library actually has.

src/cmd/ksh93/include/streval.h:
- Increase the char array to 18 bytes to fit the full length for
  the newly added math functions.
@McDutchie
Copy link
Copy Markdown

I suppose the ginormous math.sh probe would now take even longer to run. I was hoping to get rid of it entirely and limit the set of math functions to the ones that can be used portably.

It's not as if ksh is a mathematics engine. It can't even do integer arithmetic correctly. As long as #771 is not fixed, and fixed properly, I don't think this is a priority at all.

@JohnoKing
Copy link
Copy Markdown
Author

I was hoping to get rid of it entirely and limit the set of math functions to the ones that can be used portably.

Perhaps this ksh2020 commit could be of use:
a14a820

In any case the math.tab additions are a mere low hanging fruit change; this can be held off or rewritten. The math probing is horribly inefficient and archaic; most of the tested functions don't need tests at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants