File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -58,24 +58,19 @@ defmodule Calendar do
58
58
@ typedoc """
59
59
Microseconds with stored precision.
60
60
61
+ `value` always represents the total value in microseconds.
62
+
61
63
The `precision` represents the number of digits that must be used when
62
64
representing the microseconds to external format. If the precision is `0`,
63
65
it means microseconds must be skipped. If the precision is `6`, it means
64
66
that `value` represents exactly the number of microseconds to be used.
65
67
66
- The formula to calculate microseconds from this type is:
67
-
68
- microseconds = value * Integer.pow(10, 6 - precision)
69
-
70
68
## Examples
71
69
72
70
* `{0, 0}` means no microseconds.
73
- * `{1, 6}` means 1µs (`value` is `1` and the precision specifies that six digits
74
- must be used).
75
- * `{93, 3}` means 93ms (`value` is `93` and the precision specifies that three digits
76
- must be used).
77
- * `{12, 2}` means 120ms (`value` is `12` and the precision specifies that two digits
78
- must be used).
71
+ * `{1, 6}` means 1µs.
72
+ * `{1000, 6}` means 1000µs (which is 1ms but measured at the microsecond precision).
73
+ * `{1000, 3}` means 1ms (which is measured at the millisecond precision).
79
74
80
75
"""
81
76
@ type microsecond :: { value :: non_neg_integer , precision :: non_neg_integer }
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ defmodule Inspect.Algebra do
333
333
( is_tuple ( doc ) and elem ( doc , 0 ) in @ docs )
334
334
335
335
defguardp is_limit ( limit ) when limit == :infinity or ( is_integer ( limit ) and limit >= 0 )
336
- defguardp is_width ( limit ) when limit == :infinity or ( is_integer ( limit ) and limit >= 0 )
336
+ defguardp is_width ( width ) when width == :infinity or ( is_integer ( width ) and width >= 0 )
337
337
338
338
# Elixir + Inspect.Opts conveniences
339
339
# These have the _doc suffix.
You can’t perform that action at this time.
0 commit comments