Replies: 5 comments 2 replies
-
As the manual page says: “Any of the following math library functions that are in the C math library can be used within an arithmetic expression:”, etc. What functions are in the C math library depends on the operating system. Your system has |
Beta Was this translation helpful? Give feedback.
-
Should Ksh make some guarantees here? They are really useful, but if they are platform-defined it makes any shell script that uses them inherently non-portable. I just found out this is a big issue with |
Beta Was this translation helpful? Give feedback.
-
It would be nice if ksh came with its own fallback implementations, but I don't think anyone has the time or inclination to make that happen. With |
Beta Was this translation helpful? Give feedback.
-
The more I think about this, the more I think Ksh really should guarantee these functions are provided (or at least some) I was curious which functions might not be provided on different platforms based on their standard conformance, since (in theory) Ksh can be built with some elbow grease on any platform that has a C90 compiler. Here's what I was able to find. All of these exist on Linux, but I don't know about BSD and MacOS (I can check later tonight) C90: C99: TS 18661-1:2014: TS 18661-4:2015: BSD functions: SVID: Unknown: |
Beta Was this translation helpful? Give feedback.
-
@McDutchie, Would you be amenable to me killing math.tab and having math.sh checking for functions support as a group? This is what I would change and document:
|
Beta Was this translation helpful? Give feedback.
-
The man page says
isinfinite
is one of the predefined arithmetic functions, but when I go and test it:isinf(inf)
works as expected, though.Was this removed and the documentation needs to be updated? Should it be in there and no one noticed it was missing until now?
Beta Was this translation helpful? Give feedback.
All reactions