Skip to content

Commit a14959f

Browse files
committed
RFC #17: allow ceil_log2(0).
1 parent ef75103 commit a14959f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

text/0000-remove-log2-int.md renamed to text/0017-remove-log2-int.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
- Start Date: 2023-08-07
1+
- Start Date: 2024-01-08
22
- RFC PR: [amaranth-lang/rfcs#17](https://github.com/amaranth-lang/rfcs/pull/17)
3-
- Amaranth Issue: None
3+
- Amaranth Issue: [amaranth-lang/amaranth#1025](https://github.com/amaranth-lang/amaranth/issues/1025)
44

55
# Remove `log2_int`
66

@@ -40,7 +40,7 @@ In practice, `log2_int` differs from `math.log2` in the following ways:
4040

4141
Amaranth provides two log2 functions for integer arithmetic:
4242

43-
* `ceil_log2(n)`, where `n` is assumed to be any positive integer
43+
* `ceil_log2(n)`, where `n` is assumed to be any non-negative integer
4444
* `exact_log2(n)`, where `n` is assumed to be an integer power-of-2
4545

4646
For example:
@@ -64,7 +64,7 @@ A `ceil_log2(n)` function is added, that:
6464

6565
* returns the integer log2 of the smallest power-of-2 greater than or equal to `n`;
6666
* raises a `TypeError` if `n` is not an integer;
67-
* raises a `ValueError` if `n` is lesser than or equal to 0.
67+
* raises a `ValueError` if `n` is lesser than 0.
6868

6969
An `exact_log2(n)` function is added, that:
7070

@@ -114,6 +114,6 @@ None.
114114

115115
## Acknowledgements
116116

117-
[@mwkmwkmwk] provided valuable feedback while this RFC was being drafted.
117+
[@wanda-phi] provided valuable feedback while this RFC was being drafted.
118118

119-
[@mwkmwkmwk]: https://github.com/mwkmwkmwk
119+
[@wanda-phi]: https://github.com/wanda-phi

0 commit comments

Comments
 (0)