Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

5
LINES

< > BotCompany Repo | #1031926 // clampZeroToOne

JavaX fragment (include) [tags: use-pretranspiled]

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;
  }
}

Author comment

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: 149 / 215
Version history: 1 change(s)
Referenced in: [show references]