Commit Graph

220 Commits (7ef7188f4b54da7c3372b6eaf08e44ae655b779f)

Author SHA1 Message Date
Subhomoy Haldar 7ef7188f4b
math.big: add bit_len, optimize gcd, add documentation (#13872) 2022-03-30 15:52:09 +03:00
kylepritchard a8f6574471
math: allow i64 in digits function and add count_digits function (#13729) 2022-03-14 10:41:01 +02:00
Subhomoy Haldar 114a341f5f
rand: simplify rand.PRNG, move to optional types for error handling (#13570) 2022-02-23 12:36:14 +02:00
simon place 8ba4a3dd01
math.complex: make mutable the Complex.re and Complex.im fields (#13540) 2022-02-21 12:39:45 +02:00
Subhomoy Haldar 072480352c
math.big: add get_bit, set_bit, big_mod_pow (#13507) 2022-02-18 11:53:39 +03:00
Delyan Angelov 62687842e2
Revert "math: add a new math.easing module (#13226)" (#13235)
This reverts commit 758d1f44ab.
2022-01-20 18:57:53 +02:00
kahsa 758d1f44ab
math: add a new math.easing module (#13226) 2022-01-20 14:17:47 +02:00
playX c48a9e71f5
math.unsigned: add uint128 tests (#13213) 2022-01-19 11:18:46 +02:00
Delyan Angelov d8263171ff
math.mathutil: remove deprecated mathutil_test.v (workaround spurious test failures, due to same _test.v name) 2022-01-17 17:52:57 +02:00
Delyan Angelov d1ac22e3bb
math.unsigned: small fix after rename 2022-01-17 11:35:02 +02:00
playX 8de1934f51
math: add an `unsigned` module, implementing Uint128, Uint256 and methods on them (#13186) 2022-01-17 11:23:21 +02:00
Delyan Angelov 2a3a4cfc84
math.bits: fix bits.div_64 behaviour for leading_zeros_64(y) = 0 2022-01-16 18:11:23 +02:00
jeffmikels a60b381d5e
docs: adding skeleton README.md files for all vlib modules (#13034) 2022-01-05 18:06:08 +02:00
Delyan Angelov 59357e873d
math: move the `math.mathutil` generic `min`/`max`/`abs` fns to `math` (#13042) 2022-01-05 18:02:20 +02:00
Alexander Medvednikov 59ed4be49a all: update copyright year 2022-01-04 12:21:12 +03:00
spaceface d13fe7843c
v: fix build and failing tests on arm64 (#12840) 2021-12-15 09:00:38 +02:00
Delyan Angelov fe14e2fceb
cgen: use `c_name()` for escaping goto label names too 2021-12-11 19:41:44 +02:00
Wertzui123 9e68a03f94
math: rename small to small_ to prevent C errors (workaround unescaped C labels) (#12796) 2021-12-11 19:35:40 +02:00
Delyan Angelov 6d97b0a407
checker: improve checking of a << b, when a and b are numbers (#12589) 2021-11-29 03:48:49 +03:00
Andreas Schoeller f14dabc6bd
math.big: add a new greatest-common-divisor-algo for big.Integer, also add a benchmark for it (#12261) 2021-10-26 11:10:13 +03:00
czkz 29f068997b
math: add fn clamp (#12205) 2021-10-17 06:42:40 +03:00
Ulises Jeremias Cornejo Fandos 35b301f73c
math: add some benchmark tests (#12142) 2021-10-11 14:20:07 +03:00
Ulises Jeremias Cornejo Fandos 0f7dfb984a
math: remove the C backend for f64 functions (#12121) 2021-10-10 11:21:48 +03:00
playX e267106220
math: implement logarithm function in pure V (#12111) 2021-10-09 11:17:09 +03:00
05st 43931be451
math: sqrti, powi, factoriali (#12072) 2021-10-08 22:07:44 +03:00
playX a8ace2c41c
math: implement `pow` in pure V (#12105) 2021-10-08 17:44:55 +03:00
yuyi 108a01d65f
fmt: fix unnecessary line break in array init (fix #11448) (#11562) 2021-09-21 16:20:09 +03:00
czkz 396eede4db
math: fix typos (#11533) 2021-09-18 12:23:31 +03:00
Vincent Laisney 273154c1ae
math.big: add Newton and Karatsuba algorithms (#11487) 2021-09-16 19:31:07 +03:00
Daniel Däschle b63ec8fbcf
checker: require `params` attribute to use struct as keyword arguments in function (#11135) 2021-09-14 00:05:30 +03:00
Ulises Jeremias Cornejo Fandos 480fe8041a
math.stats: update math.stats using generics (#11482) 2021-09-13 10:20:38 +03:00
Vincent Laisney c8d4a64512
math.big: fix subtract_digit_array (#11451) 2021-09-09 14:56:20 +03:00
Subhomoy Haldar 96d4a0777f
math.big: fix comparison and add tests (#11449) 2021-09-08 20:30:20 +03:00
yuyi e5360e164a
fmt: remove unnecessary parentheses after `return` (fix #11423) (#11435) 2021-09-08 14:19:53 +03:00
Vincent Laisney 43fae5de74
bigint: division (#11386) 2021-09-08 14:16:35 +03:00
Subhomoy Haldar dadfda9400
math.big: implement big.integer in V (#11352) 2021-08-31 19:21:00 +03:00
playX d78e7e3b2b
js: codegen fixes, W.I.P `os` availability for JS backend (#11281) 2021-08-23 14:25:02 +03:00
Ulises Jeremias Cornejo Fandos 1cfc4198f5
vlib/math: Add a pure V backend for vlib/math (#11267) 2021-08-23 00:35:28 +03:00
playX 2f6b2dd189
js: math.big support, f{32,64}_bits,from_bits support, typeof(expr).name support (#11260) 2021-08-21 17:18:57 +03:00
playX 1570e613b5
math: inf,nan,fmod for the JS backend (#11246) 2021-08-20 01:14:49 +03:00
Miccah 19abe8c750
math.big: add from_bytes function (#11213) 2021-08-17 09:12:39 +03:00
Miccah d235de63e2
math: add egcd function implementing the extended Euclidean algorithm (#11203) 2021-08-16 11:49:50 +03:00
Delyan Angelov 900c37aa65
v.gen.c: support `T.typ` - an int for the type index of the generic type `T` (#11175) 2021-08-14 08:48:25 +03:00
Yuval Greenfield 820669b011
math.fractions: make the numerator and denominator public (#11018) 2021-08-02 18:50:11 +03:00
blackshirt 1eac351f25
math.big: change the return value of divmod to (quotient, remainder) (#10993) 2021-07-30 02:28:32 +03:00
Uwe Krüger f457b94fe4
cgen: properly support reference args in receivers and arithmetic op methods (#10873) 2021-07-20 15:08:32 +03:00
Delyan Angelov eed4f50d8c
ci: fix sanitize failures with math.big 2021-07-19 20:51:41 +03:00
Delyan Angelov 732d8101e0
math.big: add .bytes() and .bytes_trimmed() methods, `big.from_int(1024).bytes_trimmed() == [byte(0x00), 0x04]` 2021-07-19 17:17:08 +03:00
Enzo 886f69bfcf
all: use operator overloading on strings (p. 2) (#10183) 2021-05-24 11:38:31 +03:00
penguindark d8d05e0106
all: new string interpolation in pure V (#10181) 2021-05-24 05:20:45 +03:00