Libraryless. Click here for Pure Java version (39L/1K).
1 | meta-for float in float, double {
|
2 | static float clampToZeroOne(float x) {
|
3 | ret x < 0 ? 0 : x > 1 ? 1 : x; |
4 | } |
5 | } |
Began life as a copy of #1031926
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1035289 |
| Snippet name: | clampToZeroOne - synonym of clampZeroToOne |
| Eternal ID of this version: | #1035289/1 |
| Text MD5: | 069d49269c004ae0af024181344ce059 |
| Transpilation MD5: | ea8b9bbc2c9a0ec0d37b290caf2c6505 |
| Author: | stefan |
| Category: | javax / maths |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-04-29 01:41:52 |
| Source code size: | 119 bytes / 5 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 458 / 553 |
| Referenced in: | [show references] |