Answers for "bigdecimal multiply negative"

0

bigdecimal multiply negative

package com.tutorialspoint;

import java.math.*;

public class BigDecimalDemo {

   public static void main(String[] args) {

      // create 2 BigDecimal objects
      BigDecimal bg1, bg2;

      // assign value to bg1
      bg1 = new BigDecimal("40.1264");

      // assign negate value of bg1 to bg2
      bg2 = bg1.negate();

      String str = "Negated value of " + bg1 + " is "+ bg2;

      // print bg1 and bg2 values
      System.out.println( str );
   }
}
Posted by: Guest on September-23-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language