Libraryless. Click here for Pure Java version (36L/1K).
meta-for float in float, double {
static float clampZeroToOne(float x) {
ret x < 0 ? 0 : x > 1 ? 1 : x;
}
}Began life as a copy of #1018737
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
| Snippet ID: | #1031926 |
| Snippet name: | clampZeroToOne |
| Eternal ID of this version: | #1031926/2 |
| Text MD5: | 18da4cf858a29a53b36045dd6ea95934 |
| Transpilation MD5: | 9b494db1d02ecc0047cd7c9a8eb4502a |
| Author: | stefan |
| Category: | javax / maths |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-08-02 04:23:05 |
| Source code size: | 119 bytes / 5 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 522 / 658 |
| Version history: | 1 change(s) |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1031927 - zeroToOne - DoubleRange [singleton, don't mutate] #1035289 - clampToZeroOne - synonym of clampZeroToOne |