MCPcopy
hub / github.com/micro-editor/micro / Abs

Function Abs

internal/util/util.go:206–211  ·  view source on GitHub ↗

Abs is a simple absolute value function for ints

(n int)

Source from the content-addressed store, hash-verified

204
205// Abs is a simple absolute value function for ints
206func Abs(n int) int {
207 if n < 0 {
208 return -n
209 }
210 return n
211}
212
213// StringWidth returns the visual width of a byte array indexed from 0 to n (rune index)
214// with a given tabsize

Callers 4

drawLineNumMethod · 0.92
GotoLocMethod · 0.92
TabMoveCmdMethod · 0.92
MoveLAMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected