Scala Long abs() method with example Last Updated : 03 Nov, 2019 Comments Improve Suggest changes Like Article Like Report The abs() method is utilized to return the absolute value of the given integer value. The absolute value of any number is the magnitude of that number i.e, without any sign. Method Definition: def abs: Float Return Type: It return the absolute value of the given integer value. Example 1: Scala // Scala program of Long abs() // method // Creating object object Test { // Main method def main(args : Array[String]) { // Applying abs method val res = (-7002).abs // Displays output println(res) } } Output: 7002 Example 2: Scala // Scala program of Long abs() // method // Creating object object Test { // Main method def main(args : Array[String]) { // Applying abs method val res = (-7002).abs // Displays output println(res) } } Output: 23.42 Comment More infoAdvertise with us Next Article Scala Long abs() method with example S Shubrodeep Banerjee Follow Improve Article Tags : Scala Scala Scala-Method Similar Reads Scala Float abs() method with example The abs() method is utilized to return the absolute value of the given integer value. The absolute value of any number is the magnitude of that number i.e, without any sign. Method Definition: def abs: Float Return Type: It return the absolute value of the given integer value. Example #1: Scala // S 1 min read Scala Int abs() method with example The abs() method is utilized to return the absolute value of the given integer value. The absolute value of any number is the magnitude of that number i.e, without any sign. Method Definition: (Signed_Integer_Value).abs Return Type: It return the absolute value of the given signed integer value. Exa 1 min read Scala Char <(x: Long) method with example The <(x: Long) method is utilized to find if the stated character value is less than 'x' or not. And the type of 'x' must be Long. Method Definition: def <(x: Long): Boolean Return Type: It returns true if the stated character value is less than "x" else it returns false. Example: 1# Scala // 1 min read Scala Char <=(x: Long) method with example The <=(x: Long) method is utilized to find if the stated character value is less than or equal to 'x' or not. And the type of 'x' must be Long. Method Definition: def <=(x: Long): Boolean Return Type: It returns true if the stated character value is less than or equal to "x" else it returns fa 1 min read Scala Char abs() method with example The abs() method is utilized to find the absolute value of the stated character. Method Definition: def abs: Char Return Type: It returns Char. Example: 1# Scala // Scala program of abs() // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying abs() method 1 min read Like