48 Commits

Author SHA1 Message Date
Jeong YunWon
f0f4633346 Fix nightly clippy 2024-04-18 03:37:29 +09:00
Steve Shi
de0d323ad3 change dependency from num-bigint to malachite-bigint (#4952) 2023-06-08 14:28:39 +09:00
Jeong YunWon
e2ccb48463 Remove Traverse from FromArgs 2023-04-28 13:27:57 +09:00
discord9
94bdb6b97a feature: PyTraverse derive macro for traverse object's childrens(like CPython's tp_traverse) (#4872) 2023-04-23 21:43:49 +09:00
bearney74
123559478e fix fmean/fsum ValueError and test_inv_cdf 2023-03-17 01:18:47 +09:00
Jeong YunWon
bca7c16435 ArgIndex for math 2023-03-10 06:21:40 +09:00
Jeong YunWon
b60271a6cf deprecate vm.invoke 2023-03-08 01:35:30 +09:00
Kangzhi Shi
f16a48df39 Refactor Number Protocol 2022-12-24 15:42:06 +09:00
Devon Hollowood
96bf177acc Respond to reviewer comments 2022-10-27 18:27:06 -07:00
Devon Hollowood
fa50056fce Apply suggestions from code review
Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com>
2022-10-27 18:20:50 -07:00
Devon Hollowood
3739372d43 Implement more accurate hypot()
This uses the improved-accuracy hypotenuse algorithm from Borges 2019,
see https://arxiv.org/abs/1904.09481.
2022-10-26 23:44:13 -07:00
Devon Hollowood
4cfe1453e1 Accept reviewer suggestion
Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com>
2022-10-25 10:49:09 -07:00
Devon Hollowood
82b4990224 Use improved log2() implementation for log10()
This also fixes a bug in the log2() implementation, where very large
negative integer arguments would not raise an exception (and instead
would turn into NaNs).
2022-10-24 18:46:49 -07:00
Devon Hollowood
893f86e9cf Respond to reviewer comments 2022-10-23 10:17:43 -07:00
Devon Hollowood
beeb0441ef Allow log2() to work on large integers 2022-10-22 14:55:14 -07:00
Steve Shi
30aeb8bee5 Introduce PyAtomicRef and impl for PyObject.typ (#3828)
* introduce PyAtomicRef

* refactor PyObject.typ use PyAtomicRef

* add documents

* add swap_to_temporary_refs

* replace AtomicCell with PyAtomic

* fix name conflict
2022-10-15 21:53:12 +02:00
Jeong YunWon
368e47cddb Merge pull request #4151 from jopemachine/add-cbrt
Add `math.cbrt` implemented in cpython 3.11
2022-09-12 13:55:56 +09:00
Gyubong
e0f491ea8c Fix edge case of math.pow(0.0, -inf), math.pow(-0.0, -inf) 2022-09-12 12:45:56 +09:00
Gyubong
96fc308c04 Add math.cbrt
Update math.rs
2022-09-12 12:39:53 +09:00
Gyubong
1933e5f56e Add math.exp2 2022-09-08 17:00:42 +09:00
Jeong YunWon
370c4f7f60 PyObject::try_float 2022-07-24 15:05:30 +09:00
Jeong YunWon
2d1158b271 remove vm.try_index 2022-07-24 15:05:29 +09:00
Jeong YunWon
a05712fd9b no once cell 2022-07-24 15:05:12 +09:00
Kangzhi Shi
3e6e348a67 impl number protocol float 2022-05-30 07:36:08 +09:00
Jeong Yunwon
fb52694e41 PyAttributes key is PyStrInterned 2022-05-23 09:03:13 +09:00
Jeong Yunwon
84e2b52240 Deref for ArgIntoFloat 2022-04-29 10:47:59 +09:00
Jeong Yunwon
a7135024a5 &PyTuple and &PyTupleRef works like &[PyObjectRef] 2022-04-24 12:26:48 +09:00
Jeong Yunwon
0535077631 either is a function utility 2022-04-23 20:49:31 +09:00
Jeong Yunwon
fee3bf2722 AsPyObject -> AsObject because fn as_object 2022-04-18 07:19:35 +09:00
Jeong Yunwon
aa76a34963 merge TypeProtocol in AsPyObject 2022-04-17 19:26:10 +09:00
Jeong Yunwon
828c28ebb8 Replace vm.extract_elements with TryFromBorrowedObject 2022-04-17 06:09:45 +09:00
Jeong Yunwon
6357a1acbe clean up imports and useless allow attributes 2022-04-15 23:58:20 +09:00
Jeong Yunwon
3629ce5cd7 rename non-protocol PySequence to ArgSequence to avoid confusion 2022-04-14 03:26:38 +09:00
Tetramad
ebd0352cfc Fix math.log10 to pass some failed tests
Now math.log10 with less than or equal to zero should raise ValueError
with "math domain error" message if `x` fit in f64
2021-10-25 14:44:13 +09:00
Tetramad
2bedba0e12 Fix math.log2 to pass some failed tests
Now math.log2 with less than or equal to zero should raise ValueError
with "math domain error" message if `x` fit in f64
2021-10-25 14:44:13 +09:00
Tetramad
c88c69a993 Fix math.log1p to pass some failed tests
Now math.log1p with less than or equal to negative one should raise
ValueError with "math domain error" message
2021-10-25 14:44:13 +09:00
Tetramad
3d8f6cf08d Fix math.log to pass some failed tests
Now math.log with less than or equal to zero should raise ValueError
with "math domain error" message if `x` fit in f64
2021-10-25 14:44:08 +09:00
Tetramad
ba3cafc932 Fix math.atanh to pass failed tests
Now math.atanh with out of domain value should raise ValueError with
"math domain error" message
2021-10-25 10:45:11 +09:00
Jeong YunWon
b759808736 PyObj -> PyObject 2021-10-21 17:55:29 +09:00
Jeong YunWon
d4feb2a6c5 incref -> to_owned 2021-10-21 17:29:34 +09:00
Noa
8dd18d97be PyObjectRef -> &PyObj, &PyRef<T> -> &Py<T> 2021-10-21 16:49:01 +09:00
Jeong YunWon
7377664bea Remove PyFloatRef 2021-10-18 05:14:54 +09:00
Jeong YunWon
741cfea565 vm.ctx.new_int returns PyInt 2021-10-11 01:05:38 +09:00
jfh
c0420721e0 Rename from ArgTypeLike to ArgIntoType, numlike to number. 2021-10-07 15:30:57 +03:00
jfh
b2a2238566 Add ArgBoolLike. 2021-10-07 12:56:01 +03:00
jfh
856f77fb77 Add ArgFloatLike. 2021-10-07 12:34:30 +03:00
Jeong YunWon
2c8020a081 clean up py* attributes names 2021-10-02 16:59:33 +09:00
Jeong YunWon
fb25a15f2c split rustpython-stdlib crate 2021-10-01 01:54:04 +09:00