16 lines
361 B
C
16 lines
361 B
C
|
//---
|
||
|
// util: General utilities (what a surprise huh?)
|
||
|
//---
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include <stddef.h>
|
||
|
#include <stdint.h>
|
||
|
|
||
|
/* Like qsort(), but actually it's a heap sort. */
|
||
|
void heap_sort(void *base, size_t n, size_t elsize,
|
||
|
int (*compare)(void const *, void const *));
|
||
|
|
||
|
/* Integer square root (recursive, logarithmic complexity). */
|
||
|
int64_t sqrtll(int64_t n);
|