• Post Reply Bookmark Topic Watch Topic
  • New Topic

if < 0 then 0  RSS feed

 
Miran Cvenkel
Ranch Hand
Posts: 208
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I allways thought there should be a func for that, like there is abs. Is there ?
If not, can this be done shorter ?
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<please ignore my pathetic response>
 
Stephan van Hulst
Saloon Keeper
Posts: 7963
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only way I can think of that you can make this shorter is
 
Paul Clapham
Sheriff
Posts: 22819
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't that

?
 
Miran Cvenkel
Ranch Hand
Posts: 208
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that is indeed shorter.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!