add pi() to !calc, bump to 0.35.3
This commit is contained in:
parent
f6431b02a5
commit
db809715d2
2 changed files with 8 additions and 1 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2026.07.20 – Add pi() to !calc.
|
||||
|
||||
- Added `pi()` function support to `!calc`: bc -l does not define `pi()` on all systems, so `cmd_calc` now prepends a `pi()` definition before evaluating expressions. `!calc pi()`, `!calc pi()*2`, `!calc pi()^2` etc. all work.
|
||||
- Version bumped to 0.35.3.
|
||||
|
||||
2026.07.20 – Fix !time timezone conversion bug.
|
||||
|
||||
- Fixed `!time` command: `setenv("TZ",...) + localtime()` was not reliably converting to the requested timezone. Replaced with `TZ=... date` via `popen()`, which handles all IANA timezone names correctly (e.g. `!time Australia/Sydney` now shows 11:15 AEST instead of UTC).
|
||||
|
|
|
|||
4
zynk.c
4
zynk.c
|
|
@ -29,7 +29,7 @@ int asprintf(char **, const char *, ...);
|
|||
|
||||
/* ---- constants ---- */
|
||||
|
||||
#define VERSION "0.35.2"
|
||||
#define VERSION "0.35.3"
|
||||
#define DEFAULT_SERVER "irc.libera.chat"
|
||||
#define OPENCODE_BIN "/usr/bin/opencode"
|
||||
#define CLR_RESET "\033[0m"
|
||||
|
|
@ -2583,6 +2583,8 @@ static int cmd_calc(Session *s, const char *msg, const char *reply_target, const
|
|||
}
|
||||
close(in_pipe[0]);
|
||||
close(out_pipe[1]);
|
||||
const char *pidef = "define pi() { return 3.14159265358979323844; }\n";
|
||||
write(in_pipe[1], pidef, strlen(pidef));
|
||||
write(in_pipe[1], rest, strlen(rest));
|
||||
write(in_pipe[1], "\n", 1);
|
||||
close(in_pipe[1]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue