MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / round

Function round

lib/core/compat.py:226–238  ·  view source on GitHub ↗

>>> round(2.0) 2.0 >>> round(2.5) 3.0

(x, d=0)

Source from the content-addressed store, hash-verified

224
225# Reference: http://python3porting.com/differences.html
226def round(x, d=0):
227 """
228 >>> round(2.0)
229 2.0
230 >>> round(2.5)
231 3.0
232 """
233
234 p = 10 ** d
235 if x > 0:
236 return float(math.floor((x * p) + 0.5)) / p
237 else:
238 return float(math.ceil((x * p) - 0.5)) / p
239
240# Reference: https://code.activestate.com/recipes/576653-convert-a-cmp-function-to-a-key-function/
241def cmp_to_key(mycmp):

Callers 11

vulnTestFunction · 0.90
smokeTestFunction · 0.90
_findPageFormsFunction · 0.90
adjustTimeDelayFunction · 0.90
runFunction · 0.85
updateMethod · 0.85
crawlThreadFunction · 0.85
tableExistsThreadFunction · 0.85
columnExistsThreadFunction · 0.85
fileExistsThreadFunction · 0.85
_comparisonFunction · 0.85

Calls

no outgoing calls

Tested by 2

vulnTestFunction · 0.72
smokeTestFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…