mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-17 08:34:11 +02:00
Compare commits
No commits in common. "6264b34caf8791cd873c03eec5527f43a418edf5" and "b09d59bd37b90368a481d182d8e7e7f291da3ca3" have entirely different histories.
6264b34caf
...
b09d59bd37
|
|
@ -1 +1 @@
|
|||
Clarify meaning of floating-point powerlevels.
|
||||
Clarify floaty powerlevels.
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
##### `m.room.power_levels` events accept values as floats
|
||||
##### `m.room.power_levels` Events Accept Values as Floats
|
||||
|
||||
When the value is a float, anything after the decimal point is removed,
|
||||
making e.g. `5.17`, `5.42`, and `5` functionally identical.
|
||||
|
|
@ -31,10 +31,4 @@ For example, this is a valid `m.room.power_levels` event in this room version:
|
|||
```
|
||||
|
||||
In this example, both `@bob:localhost` and `@alice:localhost` have the same effective
|
||||
power level of `50`, even though the values are technically different.
|
||||
|
||||
When a float written in exponential notation is unpacked, the decimal portion is removed
|
||||
afterward; for example, `5.114698E4` becomes `51146.98`, which is then truncated to `51146`.
|
||||
|
||||
Note that, since this room version does not enforce that events comply with the requirements
|
||||
of [Canonical JSON](/appendices#canonical-json), power levels can be formatted as floats.
|
||||
power level of `50`, even though the values are visually different.
|
||||
|
|
|
|||
Loading…
Reference in a new issue