Elegant min/max absolute values in java

Posted by Stefano Borini on Stack Overflow See other posts from Stack Overflow or by Stefano Borini
Published on 2010-03-15T05:09:53Z Indexed on 2010/03/15 5:19 UTC
Read the original article Hit count: 231

Filed under:
|

I need to get the minimum and maximum values in a collection of floating point values, after applying an absolute value conversion. In python I would do this

min(map(abs, [-5, -7, 10, 2]))

how can I perform the same operation in java in the most elegant way?

© Stack Overflow or respective owner

Related posts about java

Related posts about beginner