1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Commit Graph

256 Commits

Author SHA1 Message Date
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
Delyan Angelov
20a22453cf
v.builder: remove default link flags -lm, -ldl, -lpthread (use module specific link flags instead) (#10099) 2021-05-14 14:28:53 +03:00
Delyan Angelov
7db6d602de
tools: vfmt math_test.v and remove it from the exceptions in vtest-cleancode.v 2021-05-08 14:46:06 +03:00
Cabral
b5afa049e9
math: sign function (#10014) 2021-05-08 14:32:18 +03:00
Delyan Angelov
8a380f4699
tools: make v test-cleancode test everything by default (#10050) 2021-05-08 13:32:29 +03:00
Delyan Angelov
597a774d36
scanner: speed up Scanner.skip_whitespace (~2-3% speed up of -o x.c cmd/v) 2021-05-03 14:14:32 +03:00
Delyan Angelov
d4f31412b7
v: deprecate @VROOT in favour of @VMODROOT (#9795) 2021-04-19 19:01:47 +03:00
Delyan Angelov
3e297bced4
ci: remove some tests from skip_with_werror in v test-self 2021-04-14 12:47:24 +03:00
Delyan Angelov
c0e2b9b1e2
ci: fix some of v test-cleancode 2 2021-04-05 20:55:03 +03:00
Ulises Jeremias Cornejo Fandos
5e02f6358c
math: add a test suite taken from vsl/vmath (#9280) 2021-03-13 09:05:02 +02:00
Lukas Neubert
a67d49050c
math: add a pure V math.mathutil, with generic min, max and abs functions (#9176), and use it consistently 2021-03-12 11:28:04 +02:00
Delyan Angelov
efca21e988
math: cleanup math.v, document math.aprox_cos and math.aprox_sin 2021-02-27 11:18:43 +02:00
Nick Treleaven
c03798e390
checker: disallow implicit conversion from fixed array to fooptr (#8823) 2021-02-26 00:28:47 +01:00
zakuro
ac4791045f
time: consolidate the different sleep functions into time.wait(Duration) (#8853) 2021-02-21 17:05:03 +02:00
Stanislav Ershov
c190b6a131
vlib: remove older deprecated functions (#8864) 2021-02-20 20:42:55 +02:00
Lukas Neubert
d660f2cc6f
fmt: insert newline after last HashStmt (#8482) 2021-02-01 14:50:41 +01:00
Subhomoy Haldar
5a1f3cd394
math.fractions: fix minor typo (#8386) 2021-01-28 10:02:41 +02:00
Delyan Angelov
728344ff65
ci: fix v test-cleancode 2021-01-25 12:55:01 +02:00
Alexander Medvednikov
29d6e40f29 all: vfmt (new const rule) 2021-01-24 10:54:27 +01:00
fnetX (aka fralix)
69e6ba7a64
math: small typo in math.fractions (#8298) 2021-01-24 09:37:00 +01:00
Lukas Neubert
8b61891348
fmt: smarter if condition wrapping (#8201) 2021-01-23 10:33:22 +02:00
Lukas Neubert
ac2c3847af
all: update copyright to 2019-2021 (#8029) 2021-01-18 13:20:06 +01:00
Lukas Neubert
16c9cbce7c
fmt: correctly increase f.line_len for write_indent (#8174) 2021-01-18 06:02:29 +01:00
Swastik Baranwal
334b66b311
checker/cgen: add checks and fix cgen for [typedef] for C structs (#8169) 2021-01-17 17:18:07 +02:00
Swastik Baranwal
0ca36aafe2
cgen: allow assignment operators for type aliases (#8086) 2021-01-15 02:27:19 +01:00
Nick Treleaven
3203a124b2
checker: warn when casting between reference types outside of unsafe (#7892) 2021-01-05 17:02:04 +02:00
joe-conigliaro
5f90192970
math: use full import module name in tests 2020-12-23 01:38:17 +11:00
Delyan Angelov
93c0f503a2 math.big: make big.from_string take a decimal, add big.from_hex_string 2020-12-22 09:45:56 +02:00
Alexander Medvednikov
939e10cb28 math.big: minor clean up 2020-12-22 08:27:50 +01:00
Alexander Medvednikov
b3e0926601 json: decode/encode time.Time 2020-12-22 07:24:44 +01:00
LilEnvy
665e6cc957
math.big: fix big.from_string #7313 (#7351) 2020-12-16 02:23:02 +01:00
Delyan Angelov
d91634985f
ci: fix math.bits.max_u64/math.bits.max_u32 2020-12-15 10:52:57 +02:00
Delyan Angelov
d155d8d3f0
vlib: prepare atoi.v and utf8.v for -Wimpure-v 2020-12-15 10:17:46 +02:00
LilEnvy
069d77d1c5
math.big: implement decimal .str() for big numbers (#7314) 2020-12-14 11:53:18 +02:00
Delyan Angelov
7d9d42b2e2
math.fractions: document the remaining functions in math.fractions 2020-12-05 12:23:18 +02:00
Delyan Angelov
dab66593fc vlib: run vfmt over vlib files, so that v doc -m vlib/ can run without warnings 2020-10-21 12:54:10 +03:00
Delyan Angelov
5d4cce3e95 ci: fix failing tests 2020-10-15 15:42:16 +03:00
Alexander Medvednikov
7da1afa140 all: switch to the new fn arg syntax everywhere; add lots of vfmt -verify tests 2020-10-15 12:32:28 +02:00
Delyan Angelov
5526954fdc vdoc: cleanup warnings on ./v doc -s vlib 2020-08-28 09:03:22 +03:00
Swastik Baranwal
b2e79dbebd
parser: add an error for import mod.sub as mod and import mod as mod (#6194) 2020-08-23 02:12:25 +02:00
Delyan Angelov
9c9533dad9
checker: add error for fn f() Struct { return &Struct{} } (#6019) 2020-07-29 21:40:43 +02:00
Delyan Angelov
78e1127d99
cgen: treat the main module like any other v module 2020-07-01 00:53:53 +02:00
spaceface777
624005bbd0
tcc_win: fix tests 2020-06-19 12:54:56 +02:00
Delyan Angelov
0a07dc5762 Revert "_vinit: use static initialization of large const []number"
This reverts commit b306c04e99.
2020-06-12 09:57:38 +03:00
Delyan Angelov
b306c04e99 _vinit: use static initialization of large const []number 2020-06-12 09:41:32 +03:00
Alexander Medvednikov
13a7ce9e69 gg: GG => Context 2020-06-04 20:26:18 +02:00
Uwe Krüger
cf9498ef6b
cgen: use standard checks for float comparisons 2020-06-04 19:47:41 +02:00
Uwe Krüger
076089d3c5
checker: apply stricter type checks to function args and return types 2020-06-01 21:15:59 +02:00
Uwe Krüger
fd4d28b7b6
tests: update for stricter type checks 2020-05-24 21:07:32 +02:00
yuyi
dda875a9c8
all: unify const names to snake_case 2020-05-22 17:36:09 +02:00
Uwe Krüger
2635be511f
all: re-apply C++ support 2020-05-18 21:38:06 +02:00
Alexander Medvednikov
07a78b2843 Revert "all: C++ compiler support"
This reverts commit 9a237c3e82.
2020-05-18 17:05:48 +02:00
Uwe Krüger
9a237c3e82
all: C++ compiler support 2020-05-18 15:51:36 +02:00
yuyi
7f4cf08516
parser: check (mut f Foo) syntax 2020-05-17 13:51:18 +02:00
Hungry Blue Dev
b138cadbcb
math.fractions: add approximation.v and tests 2020-05-17 12:00:29 +03:00
Alexander Medvednikov
c3fe2135a4 math.fabs 2020-05-14 16:58:20 +02:00
Hungry Blue Dev
3270545953
fraction: simplify variable names 2020-05-13 18:39:19 +02:00
Hungry Blue Dev
e52d35bf16
math.fraction: improve documentation, remove unnecessary mut modifiers 2020-05-11 07:20:55 +03:00
Hungry Blue Dev
8aba3eaa07
math.fractions: refactor and add more tests 2020-05-10 16:25:33 +02:00
Hungry Blue Dev
dbb3c2a4cd
math.fractions: improve .equals() 2020-05-08 15:39:23 +03:00
Major Taylor
7d32476841
math: extract platform specific wrapper functions to math.c.v and math.js.v 2020-05-07 08:47:24 +03:00
yuyi
9f4d498ff1
all: updateimport () and []array 2020-04-26 13:49:31 +02:00
eyelash
b495dac780
fix a few warnings
Good find, @eyelash .
2020-04-26 12:42:44 +03:00
yuyi
54a02996f2
cgen: fix string interpolation float type 2020-04-16 07:30:25 +02:00
Delyan Angelov
3ea563291c big.v: use again @VROOT/ for #flags 2020-04-10 13:09:04 +03:00