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

7
LINES

< > BotCompany Repo | #1018916 // primitiveTypeSize

JavaX fragment (include)

1  
static int primitiveTypeSize(Class c) {
2  
  if (c == byte.class || c == bool.class) ret 1;
3  
  if (c == short.class || c == char.class) ret 2;
4  
  if (c == int.class || c == float.class) ret 4;
5  
  if (c == long.class || c == double.class) ret 8;
6  
  ret 0;
7  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1018916
Snippet name: primitiveTypeSize
Eternal ID of this version: #1018916/3
Text MD5: 58a511efd8121fc64024729eb2270ebd
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-20 15:32:32
Source code size: 255 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 339 / 394
Version history: 2 change(s)
Referenced in: [show references]