Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. package metaobjectTest
  2.  
  3.  
  4. @doc{*
  5. This is a literal number annotation, an identifier follows a literal
  6. number. The syntax for this annotation is
  7. nbin or nBin or nBIN
  8. in which 'n' is a literal number in base 2. 'n' can have numbers and
  9. underscores but it should start with a number (otherwise the
  10. compiler will consider it as an identifier). The metaobject uses method
  11. Integer.valueOf(n, 2)
  12. to parse the number 'n' in base 2.
  13.  
  14. *}
  15. object Number_bin
  16.  
  17. func run {
  18. assert 101bin == 5;
  19.  
  20. assert 10BIN == 2;
  21.  
  22. assert 111_111Bin == 63;
  23.  
  24. }
  25.  
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement