File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Sources/DiffableTextKitXNumber/Graphs Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -39,16 +39,9 @@ where Value: _Input & FixedWidthInteger {
3939 /// - Limited by longest sequence of 9s due to IntegerFormatStyle.
4040 fileprivate init ( ) where Value: LosslessStringConvertible {
4141 let limit = Value ( clamping: Int . max)
42- //=--------------------------------------=
43- // Precision
44- //=--------------------------------------=
4542 self . precision = Int ( floor ( log10 ( Double ( limit) ) ) )
46- let nines = String ( repeating: " 9 " , count: precision)
47- //=--------------------------------------=
48- // Bounds
49- //=--------------------------------------=
50- self . max = Value ( nines) ! // max <= precision, 9s <= Int.max
51- self . min = Value . isSigned ? Value ( " - " + nines) ! : Value . min
43+ self . max = Value ( String ( repeating: " 9 " , count: precision) ) !
44+ self . min = Value ( clamping: - 1 ) * max // zero when unsigned
5245 }
5346
5447 //=------------------------------------------------------------------------=
You can’t perform that action at this time.
0 commit comments