MCPcopy Index your code
hub / github.com/processing/processing / FloatToS15_16

Method FloatToS15_16

core/src/processing/opengl/LinePath.java:608–617  ·  view source on GitHub ↗
(float flt)

Source from the content-addressed store, hash-verified

606
607
608 static int FloatToS15_16(float flt) {
609 flt = flt * 65536f + 0.5f;
610 if (flt <= -(65536f * 65536f)) {
611 return Integer.MIN_VALUE;
612 } else if (flt >= (65536f * 65536f)) {
613 return Integer.MAX_VALUE;
614 } else {
615 return (int) Math.floor(flt);
616 }
617 }
618
619
620 static float S15_16ToFloat(int fix) {

Callers 3

strokeToMethod · 0.95
pathToMethod · 0.95
setParametersMethod · 0.95

Calls 1

floorMethod · 0.80

Tested by

no test coverage detected