* Added log and round functions to math module
* Added log and round functions to math module
* Added a few math functions
* Static checks
* Maybe this will fix linux
* Fixed errors with styles and tests
This function takes in 3 arguments: the string, the position and the
length (of the substring). As a quick example, a call to the function
`str_sub('c programming', 3, 11)`
will return the string 'programming' as the substring to the string
that is provisioned to the function call.
Functions added are: `sinh(x)`, `cosh(x)`, `tanh(x)`, `asin(x)`,
`acos(x)`, and `atan(x)`.
In addition, basic tests added in core.pk for these functions.
* Implement proper number literal parsing
- Scientific notation support
- Correct error handling in cases of invalid digits present in binary or
hex literals (0b123, 0x013FK).
* Fix style linter issues
* Support +/- in number literal exponent, add tests
- Add tests for scientific notation number literal parsing
- Add support for +/- in scientific notation exponents
This commit implements list addition. A new list is allocated, and
the contents of l1 and l2 are concatenated onto the list.
This is done by extending the buffer template macro to support a
`concat` operation, which given an `other` buffer, appends all
elements of the `other` buffer to the end of the `self` buffer.
Allocations are done as needed.
We implement this additional operation, since the alternative would
be to call `reserve()` for each `write()` operation, which doesn't
seem ideal.
Issue: #55
This commit addresses issue #54 in an attempt to add more bitwise
operators to pocketlang. Tests have also been written to verify that
the operators indeed works as expected.
To add, I also introduced a macro PK_RIGHT_OP that just aliases the
string "Right operand" which was already getting too hardcoded and
appearing too much in the pk_core.c file.
* Fix#54: Add bitwise OR operator and make it available in PKVM
Like the bitwise AND, this is an implementation for pocketlang to
support the bitwise OR operation. In addition, updated "value" ->
"result" in other operation to correctly reflect the container's
purpose. It's indeed the result after the operation, which is a value
too.
In addition, add tests for bitwise AND (&) and bitwise OR (|). Add a
print statement in test file with message that all tests passed with
no errors.
* Fix typo in comment
* Cleanup fixes
I've also written tests in the corresponding test files, please have
a look. But on the command line (after compiling the source), do:
>>> from math import *
>>> print(cos(1))
[ results will be displayed here ]
>>> print(tan(1))
[ results will be displayed here ]