b7c3972949
fix: remove leftover dbg!()
2026-08-09 10:59:11 -07:00
d7b77fe5b5
refactor: use a more generic flake style
2026-08-09 10:52:42 -07:00
4bdb51968f
fix: combine arguments in the correct order
...
`tylc 40e3 / 6e3` interpreted the args as "6e3/40e3"
(before this change)
2026-07-27 22:28:05 -07:00
262c55b91a
feat: add back single ampersand
2026-07-24 21:57:30 -07:00
704ef81816
feat: ignore and add back single equal sign
...
more than one is likely a user mistake and a panic still makes sense
should also add back '&' in the same way, if applicable
2026-07-24 21:50:58 -07:00
0dc140909f
docs: reflow comments
2026-07-24 14:23:28 -07:00
4dcbc94e0f
style: use Self where possible
2026-07-24 11:38:51 -07:00
442dc5fd91
fix: 1e-1 edge case
...
the "wrap up any unfinished parsing" section doesn't need to be changed,
since this edge case is only valid when there is a number after the '-'
which there never is in the case of only one extra character
in other words, 1e- is not valid:
`NumberParsing("1e-", ParseFloatError { kind: ExpNoDigits })`
2026-07-24 11:26:56 -07:00
431ea5b67e
feat: recognize dedicated minus sign
...
> As per Unicode 17.0.0, the ASCII hyphen-minus is not a mathematical symbol. To express the minus sign in math, U+2212 − MINUS SIGN is used instead.
https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode#cite_ref-7
2026-07-21 14:23:37 -07:00
6e141a0132
refactor(significant_digits): obsolete temp value
...
also use the correct value for if all digits are significant,
since we filter out the dot(s). in practice though, this is very rare.
2026-07-21 13:29:38 -07:00
f9d4290659
fix(significant_digits): ignore dot completely
2026-07-21 13:21:03 -07:00
c108d3a2d2
fix(significant_digits): account for no dot or many dot
2026-07-21 13:20:47 -07:00
2b7884e802
feat: add Plank's constant 'h'
2026-07-21 10:31:00 -07:00
48a1da47fb
fix: implicit operator for adjacent parenthesis
2026-07-20 20:25:10 -07:00
016e21ac5a
fix: include '9' when checking for any more digits
2026-07-20 20:13:39 -07:00
ca6af4d06f
tests: for significant digits
2026-07-20 19:41:50 -07:00
6e14c4e967
style: don't bury fn main
2026-07-20 19:34:44 -07:00
c8bc766e2a
feat: also check consecutive nines
...
fixes `tylc "12.0096 + 15.9994 * 2"`
2026-07-20 19:32:22 -07:00
909bcfef6d
feat: trim out consective zeros
...
instead of clamping the number of significant digits
fixes `tylc "14.00643 + 1.00784 * 4 + 35.446 + 15.9994 * 4"`
2026-07-20 19:31:39 -07:00
42ccff8b12
fix: maximum significant digits
...
oops :3
2026-07-16 11:39:22 -07:00
9372d5dfa8
feat: support unicode mult & div
2026-07-16 11:36:21 -07:00
4d7a806caa
feat: support sqrt
...
other roots may prove to be quite a challenge,
since I would need to parse the syntax `root(base, value)`
2026-07-16 11:33:03 -07:00
93d8147048
feat: set a max for displayed significant digits
2026-07-16 11:29:51 -07:00
50358db183
refactor: significant digits calculation out of fn main
2026-07-16 11:25:48 -07:00
7c4074113f
feat: shorthand to concatonate arguments
...
in the shell this allows for `tylc 1 + 1`,
making it equivelent to `tylc "1+1"`
this makes implementing other arguments difficult/impossible, though
2026-07-16 11:01:58 -07:00
cf8d218b11
refactor: use compiler builtin constant for pi
...
as per clippy lint
2026-07-16 10:55:23 -07:00
ae0f2a3aaf
feat: print a reasonable number of significant digits
2026-07-16 10:51:44 -07:00
fc06e1e981
feat: add constant pi
...
copy and pasted from ALEKS calculator,
as I gave up trying to find what the best approximation to use would be.
2026-07-16 00:36:46 -07:00
8d26022403
tests: implicit_mult
2026-07-16 00:30:53 -07:00
9b59323306
refactor: context errors
2026-07-16 00:28:04 -07:00
a88ec153ce
fix: flawed function parsing
...
enumerating after filtering made the index unusable
2026-07-16 00:23:33 -07:00
2ca3abf42f
feat: implicit mult
2026-07-16 00:13:37 -07:00
b9fc3c1eec
refactor: sort all from_str-like impls together
2026-07-16 00:02:05 -07:00
c4a1d670ca
docs: minor logic block explanations
2026-07-15 23:52:59 -07:00
7f733c1053
feat: generalize error InvalidFunction -> UnrecognizedName
2026-07-15 23:49:57 -07:00
33862c602d
tests: for constants
2026-07-15 23:47:35 -07:00
d27a59df17
feat: add constants
2026-07-15 23:42:49 -07:00
e7a9358bd0
refactor: consistency
2026-07-15 23:17:45 -07:00
cc88a4240a
docs: explain some of the string parsing
2026-07-15 23:13:09 -07:00
f22011e59e
feat: add some trig functions
2026-07-15 22:09:23 -07:00
d17c021fc2
tests: obsolete shorthand
2026-07-15 21:57:47 -07:00
6b33b5569d
tests: add shorthand, unary_operators
2026-07-15 21:54:26 -07:00
ee18ae3222
fix: recognize unary operators
2026-07-15 21:51:12 -07:00
d54c9636ca
refactor: simplify from_str logic slightly
2026-07-15 21:26:06 -07:00
0b0d4a960f
fix: match 'e' and '.' as numeric
2026-07-14 17:32:50 -07:00
ff152cccea
chore: add licensing
2026-07-13 21:58:26 -07:00
2746345cc6
refactor: OOP a little
2026-07-13 21:53:37 -07:00
877ae39d23
feat: read from stdin if argument missing
2026-07-13 20:09:48 -07:00
da960610f4
refactor: remove temporary attribute
2026-07-13 19:56:13 -07:00
3719464054
refactor: apply clippy hints
2026-07-13 19:55:58 -07:00