Commit Graph
97 Commits
Author SHA1 Message Date
Jonatan Männchen 980500551c Inline Licence Info & Copyright for non-test files (#14256) 2025-02-07 21:11:09 +01:00
Mikael Fangel 0c7459e6fd Simplify Integer.digits/2 (#13899) 2024-10-13 23:27:35 +09:00
José Valim 1d0f0a8614 Optimize days_in_previous_years 2024-05-15 15:42:32 +02:00
José Valim 14f3a1e372 Deprecate single quotes as charlists 2023-10-29 13:30:03 +01:00
sabiwara 29bf449f3f Evaluate formating charlists as ~c sigils (#12064) 2022-08-10 06:47:00 +02:00
Eksperimental ea717ba256 Removes/Adds qualified calls to Kernel (#11852) 2022-05-21 08:20:30 +02:00
José Valim 7a9a00d9e2 Add power operator (#11241) 2021-09-14 11:08:34 +02:00
Wei Huang 2275215988 Use a b instead of n for Integer.extended_gcd (#11240)
a and b matches the documentation and this also makes the heading in
doc to be `def extended_gcd(a, b)` instead of `def extended_gcd(n, n)`.
2021-09-12 22:34:43 +02:00
thepeoplesbourgeois fbcd373162 Tail-call recursion guarded_pow (#10932) 2021-04-20 17:33:43 +02:00
Eksperimental c91a02946d Minor improvements to Integer docs (#10837) 2021-03-30 07:52:43 +02:00
José Valim 176a693ef8 Require Erlang/OTP 22+ 2021-03-29 20:15:39 +02:00
Eksperimental 3653167577 Remove Integer.to_string/1 and Integer.to_charlist/1 (#8777)
They are not needed, since they are covered by their /2 version.
2021-03-29 17:53:19 +02:00
José Valim b849235472 Support stepped ranges (#10810) 2021-03-25 07:32:06 +01:00
Eksperimental 8dccdf49ee Improve spec in Integer.parse/2 (#10776) 2021-03-09 15:23:17 +01:00
José Valim 7d2704dedb Revert "Improve perf for Integer.gcd (#10571)" (#10572)
This reverts commit b18bf3aa80.
2020-12-13 18:08:58 +01:00
Thomas Cioppettini b18bf3aa80 Improve perf for Integer.gcd (#10571)
If the two integers are equal to one another,
we can immediately exit.
2020-12-13 17:18:05 +01:00
José Valim 8e41328396 Verify arith error on bad inputs 2020-12-03 14:42:08 +01:00
José Valim 3b6676b729 Add Integer.pow/2 and Float.pow/2 (#10528) 2020-12-03 14:11:45 +01:00
Timmo Verlaan 50b03b9c72 Optimize binary pattern matching in Integer.parse (#9201)
Matching with is_binary once is a slight performance gain, only
noticeable on long numbers. It also makes the FunctionClauseError more
clear: `** (FunctionClauseError) no function clause matching in
Integer.parse/2` vs `** (FunctionClauseError) no function clause
matching in Integer.count_digits/2`
2019-07-07 14:07:30 +02:00
Eksperimental c6ab8f7a6f Fix overlapping domains in Dialyzer (#9046) 2019-05-19 15:20:41 +02:00
Eksperimental f96dda59e2 Revert #8777 (#9042)
Revert "Remove Integer.to_string/1 and Integer.to_charlist/1 (#8777)"

This reverts commit df2584945d.
2019-05-15 09:15:55 +02:00
Eksperimental df2584945d Remove Integer.to_string/1 and Integer.to_charlist/1 (#8777)
They are not needed, since they are covered by their /2 version.
2019-02-07 09:29:10 +01:00
José Valim 6a69616dd1 Update removal and deprecation annotations
In particular, all deprecated code would be removed on v2.0,
so we don't need to annotate dperecated code with a TODO to
remove it on v2.0.
2018-12-21 13:27:06 +01:00
Mitchell Henke a1edfa7d0d update undigits doc 2018-09-25 08:46:34 -05:00
Gabe Jackson a7127fe4a6 Fix wrong arity in Integer docs (#8181)
Closes #8180
2018-09-10 04:42:32 -07:00
László Bácsi 47a8b7f6d5 Support adding arbitrary docs metadata with @doc keyword() (#7852) 2018-07-11 10:19:38 +02:00
English3000 e921c3c5f2 Beginner-friendly revisions to Elixir's documentation (#7821) 2018-07-05 08:33:53 +02:00
Ben Porter 3ead89248f Fix some grammar in the docs for Integer.parse/1 (#7761) 2018-06-18 09:17:22 +02:00
José Valim 2fabeb60c2 Move stdlib deprecations to @deprecated attribute (#7637) 2018-05-03 20:31:34 +02:00
Aleksei Magusev f027a6f2e1 Format all the examples in the docs (#7318) 2018-02-06 07:27:13 +01:00
Devon Estes a7baa692bd Add @since documentation for 1.4 release (#7238)
This adds the `@since` attribute, documenting what new functions were
added in the 1.4 release.
2018-01-20 15:04:09 +01:00
Devon Estes 7703b0f2ad Add @since attributes for APIs added in v1.5 (#7223) 2018-01-19 23:33:10 +01:00
Marcin Szczepaniak b0e72f1e6d Simplify recursion in Integer.digits (#7190) 2018-01-09 14:01:29 +01:00
José Valim 49cf54762d Remove unecessary digit/undigit clauses, closes #7187 2018-01-07 22:23:52 +01:00
James Fish 2044a02c76 Do not raise on non-integer values in is_odd/is_even (#7063) 2017-11-26 12:54:37 -02:00
José Valim c6233421e5 Format more files with little formatting requirement 2017-10-11 00:28:10 +02:00
Andrea Leopardi 87ed7b237d Fix the spec and docs for Integer.undigits/2 2017-08-22 00:02:44 +02:00
Eksperimental f54e5b1288 Standardize arguments in Integer.gcd/2 (#6198) 2017-06-07 08:57:32 +02:00
Aleksei Magusev 27754ea5c8 Various minor improvements 2017-05-09 00:33:54 +02:00
Michał Muskała 81ea1e4bf5 Simplify integer parsing (#6081)
Separate extracting the sign from the rest of the pass.
This allows drastically limiting the number of generated cases and
reduces the complexity of the code, speeding it up at the same time.
2017-05-08 21:43:56 +01:00
Brian Alexander 5bd181539b Integer.parse/2 simpler and faster (#6044) 2017-05-01 00:27:10 +02:00
Eksperimental 4c149fb937 Integer.gcd/2 improvements (#5946) 2017-04-10 02:41:38 +09:00
Andrea Leopardi 7c1dcde0d3 Slightly polish docs for Integer.gcd/2 2017-04-06 08:55:38 +02:00
Xavier Noria 8ce3ea0214 Add a test suite for Integer.gcd/2 (#5945) 2017-03-30 11:38:04 +02:00
Xavier Noria 6e0e1468c9 Document the edge case Integer.gcd(0, 0) [ci skip] (#5944) 2017-03-30 11:29:55 +02:00
Aleksei Magusev c203d8fb5c Fix Integer.gcd/2 to not raise for zeros 2017-03-30 01:04:44 +02:00
Qqwy / Wiebe-Marten bcd40efac2 Improve {(Naive)DateTime, Date, Time}.diff/2 (#5923) 2017-03-28 14:24:30 +02:00
Jeff Kreeftmeijer 1e43701f39 Restore (deprecated) Integer.to_char_list/2 (#5928) 2017-03-25 14:05:54 +01:00
James Fish e5e81b5f1b Optimise integer parsing (#5859) 2017-03-10 19:34:17 +00:00
Gal Tsubery 0a16ade542 Fix integer invalid base error message (#5826) 2017-03-01 10:12:59 +01:00