codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <stdint.h> #include <stdlib.h> inline int16_t getContainerPos(int16_t p, int16_t d) { return (p>=0 ? p : p-d+1) / d; } inline int16_t getContainerPos2(int16_t p, int16_t d) { return (p>=0 ? p : p-d+1) / d; } int main(void) { volatile int16_t r; int16_t d; for (size_t i = 0; i < 4000000; i++) { for (size_t j = 0; j < 100; j++) { d = rand(); if (d == 0) d++; r = getContainerPos(rand(), d); } } return 0; }
Private
[
?
]
Run code
Submit