Skip to content

VSaikiranOwn/demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

demo

Logical Programs package com;

import java.math.BigDecimal;

public class FloatingPoints {

private double number1 = 10.45;
private double number2 = 9.30;

private BigDecimal decNum1 = new BigDecimal(10.45);
private BigDecimal decNum2 = new BigDecimal(9.30);

private BigDecimal decimalNum1 = new BigDecimal("10.45");
private BigDecimal decimalNum2 = new BigDecimal("9.30");

public void subtractDoubleValues() {
	System.out.println("Subtraction With Double Data Types : " + (number1 - number2));
	System.out.println("Subtraction With Double Constructor of Big Decimal Class : " + (decNum1.subtract(decNum2)));
	System.out.println("Subtraction With String Constructor of Big Decimal Class : " + (decimalNum1.subtract(decimalNum2)));
}
public static void main(String[] args) {

	FloatingPoints floatingPoint = new FloatingPoints();
	floatingPoint.subtractDoubleValues();

}

}

About

Logical Programs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published