Libraryless. Click here for Pure Java version (40L/1K).
static float rclamp(float a, float b, float x) { ret x < a ? a : x > b ? b : x; } static double rclamp(double a, double b, double x) { ret x < a ? a : x > b ? b : x; } static int rclamp(int a, int b, int x) { ret x < a ? a : x > b ? b : x; } static long rclamp(long a, long b, long x) { ret x < a ? a : x > b ? b : x; }
Began life as a copy of #1018737
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1032595 |
Snippet name: | rclamp |
Eternal ID of this version: | #1032595/1 |
Text MD5: | 214619ec659ec7390cc09692cef2fa41 |
Transpilation MD5: | 10a7d7fe1f18149bf9a63e068da97c85 |
Author: | stefan |
Category: | javax / maths |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-09-23 09:24:07 |
Source code size: | 344 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 123 / 181 |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |