Commit Graph

46 Commits

Author SHA1 Message Date
writtic
ed075cf71c Update remainder module of math
- Implement remainder function with test case
  - math.remainder was added to CPython in 3.7 and RustPython CI runs on 3.6
2019-11-11 22:27:46 +09:00
johan.park
533aa2bc26 Update fmod module of math
- Implement fmod function with test case
2019-10-20 14:55:23 +09:00
johan.park
731186a23d Improve modf module of math
- Add INF, NINF, NAN test case
- Apply code relevant to added the test case on the modf code
2019-10-19 10:36:20 +09:00
Johan
6270344740 Update isclose module of math (#1532)
- Implement `math.isclose()` function with test case
  - Add `IsCloseArgs` struct for `keyword_only` argument: `rel_tol`, `abs_tol`
- Change order of test case on `math_module.py` for readability
  - Clippy recommends using `std::f64::EPSILON` instead of `==` but purpose is different
- Fix multiline declaration on the function parameters
2019-10-16 23:25:53 +09:00
Jeong YunWon
6c0f852b62 Refactor pymethod return types to be smaller as possible 2019-10-11 03:27:23 +09:00
johan.park
040c290a6e Apply clippy 2019-09-22 16:27:38 +09:00
johan.park
db10a82cbe Update copysign module of math
- Implement copysign function with test case
- Add constants of NAN, INF, NINF on top of `math_module.py`
2019-09-22 16:12:41 +09:00
Aviv Palivoda
6a6a10afa1 Use IntoPyFloat in math.rs 2019-09-14 12:50:58 +03:00
Marcin Pajkowski
c4db8d6538 Add math.modf function 2019-08-17 23:14:53 +02:00
johan.park
c8d8acdcdf Fix TypeError issue
- Using python reference type instead of arg_check
- Add TypeError assertion on test case
- Add TypeError assertion of frexp method
2019-08-17 00:44:00 +09:00
johan.park
20cb32bf1a Fix code for rustfmt and clippy 2019-08-16 23:10:13 +09:00
johan.park
b38a280ea1 Update ldexp module of math 2019-08-16 23:03:55 +09:00
johan.park
fddbbc701f Fix code for rustfmt and clippy 2019-08-16 17:23:43 +09:00
johan.park
7b5f574847 Change statement from match to if 2019-08-16 14:49:28 +09:00
johan.park
8e8c09ce6b Fix switched comment position 2019-08-16 14:35:43 +09:00
johan.park
48ae9a309d Update factorial module of math
- Implement factorial function with test case
- Deal with Negative input as a ValueError
2019-08-16 14:28:35 +09:00
Windel Bouwman
589c431c8c Merge master branch 2019-08-15 18:59:29 +02:00
Marcin Pajkowski
e65e9ff7c3 Make func_ref an &PyObjectRef 2019-08-15 13:45:47 +02:00
Windel Bouwman
d06dec77ea Attempt to reduce the size of the pyobject.rs files by splitting out builtin types. 2019-08-14 19:08:47 +02:00
yf
7b9d54f77a Add math.gcd 2019-08-08 01:51:46 +08:00
Maxim Kurnikov
8a5182a8a1 make get_method_or_type_error() error message lazy 2019-06-07 16:08:37 +03:00
Maxim Kurnikov
3bfd66bb89 make some exception messages more compatible with CPython, split get_method() into two methods and make raising TypeError more explicit for get_method() errors 2019-06-03 19:46:32 +03:00
Jeong YunWon
d223af645b Add math.frexp 2019-05-17 01:12:43 +09:00
Jeong YunWon
6afe78c9a6 Add math.ceil / math.floor 2019-04-29 04:26:10 +09:00
Jeong YunWon
c3714c2eca Add math.trunc 2019-04-29 04:26:10 +09:00
Darren Kaste
a8e064b1c0 Import TypeProtocol before use in type_check! 2019-04-14 17:19:44 -04:00
Adam Kelly
9ed051e3b7 Module Initialisation takes VirtualMachine rather than PyContext. 2019-04-05 09:50:31 +01:00
coolreader18
a9051ab462 Convert all &mut VirtualMachine to &VirtualMachine 2019-03-22 01:48:14 -05:00
Joey
7bfd2e6e84 Move function items out of pyobject module 2019-03-15 21:27:11 -07:00
Adam Kelly
0ff5155af9 Rename mk_module to make_module. 2019-03-10 17:10:51 +00:00
Windel Bouwman
5bd2db817f Merge pull request #516 from RustPython/joey/argcheck-objtype
Don't require objtype import to use arg_check! macro
2019-02-21 20:49:14 +01:00
Windel Bouwman
2c1afc4ef0 Merge pull request #513 from RustPython/py_module_macro
Py module macro
2019-02-21 20:47:35 +01:00
Joey
eec76ef8e8 Don't require objtype import to use arg_check! macro 2019-02-21 08:38:02 -08:00
Adam Kelly
727b895930 Use py_module for math. 2019-02-21 14:06:57 +00:00
Joey
df76ffe116 Replace most relative imports with 2018-style crate 2019-02-20 08:50:53 -08:00
Windel Bouwman
aaf0eab530 Merge pull request #342 from ZapAnton/fix_collapsible_if
Fixed the 'collapsible_if' clippy warnings
2019-02-05 23:34:29 +01:00
ZapAnton
b0cbb23b43 Fixed the 'collapsible_if' clippy warnings
Relevant clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
2019-02-05 21:49:07 +03:00
Timur
b25aab006e Add type conversion to functions calls in math 2019-02-04 22:22:18 +03:00
Windel Bouwman
0215830aaa Move set_attr and set_item to context. 2018-12-12 19:41:09 +01:00
yodalee
68892fb4e2 fix rustfmt 2018-11-25 22:13:26 +08:00
yodalee
04548db1e0 add implementation of special math function
function include: erf, erfc, gamma, lgamma
use package statrs' implementation
2018-11-25 20:10:34 +08:00
Windel Bouwman
133d72fcb1 Add tokenize module. Change call_method to take a reference to a PyObjectRef. Add new method to list class. 2018-10-14 15:21:48 +02:00
Windel Bouwman
d3b0c872ec Add additional math functions to math module 2018-10-14 12:17:36 +02:00
Windel Bouwman
bc60969091 Update formatting and readme file 2018-10-13 09:44:42 +02:00
Windel Bouwman
70c7f275cb Create spiffy macro to generate math functions. 2018-10-10 19:15:36 +02:00
Windel Bouwman
e782342d36 Add initial math module 2018-10-10 18:54:19 +02:00