Skip to content

Commit 5b05fe8

Browse files
committed
RFC #66: Disallow negative frequencies.
1 parent 1b66446 commit 5b05fe8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

text/0066-simulation-time.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ It is immutable and has a constructor accepting at most one named argument, givi
3838
- `Period(MHz: numbers.Real)`
3939
- `Period(GHz: numbers.Real)`
4040
- The argument will be scaled according to its SI prefix and its reciprocal used to calculate the closest integer femtosecond representation.
41-
A value of zero will raise `ZeroDivisionError`.
41+
- A value of zero will raise `ZeroDivisionError`.
42+
- A negative value will raise `ValueError`.
4243

4344
To convert it back to a number, the following properties are available:
4445
- `.seconds -> float`
@@ -54,6 +55,7 @@ To calculate the reciprocal frequency, the following properties are available:
5455
- `.megahertz -> float`
5556
- `.gigahertz -> float`
5657
- Accessing these properties when the period is zero will raise `ZeroDivisionError`.
58+
- Accessing these properties when the period is negative will raise `ValueError`.
5759

5860
The following operators are defined:
5961
- `.__lt__(other: Period) -> bool`
@@ -135,7 +137,7 @@ None.
135137
## Unresolved questions
136138
[unresolved-questions]: #unresolved-questions
137139

138-
- Should we disallow passing a negative frequency or accessing a frequency property on a negative period?
140+
None.
139141

140142
## Future possibilities
141143
[future-possibilities]: #future-possibilities

0 commit comments

Comments
 (0)