Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Implementing floor/ceil in C

Name: Anonymous 2011-06-01 13:00

how is it implemented

Name: Anonymous 2011-06-01 14:17

>>7
That's the canonical portable implementation. There are also CPU architecture specific implementations in the corresponding directories in the glibc/eglibc source package.

OP, I suggest you read the following: http://floating-point-gui.de/

Most CPU's have different instructions for setting the rounding and denormal modes of the FPU. Modern x86-64 CPUs have deprecated the FPU in favor of SSE and AVX and have individual instructions for rounding scalar and vector numbers in different fashions, without need to set rounding mode state.

So, ceil, floor, round, rint, etc. all distill down to one or two instructions each.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List