Java Big Data multiplication, java Big Data

Source: Internet
Author: User

Java Big Data multiplication, java Big Data

Import java. io .*;

Import java. util .*;

Import java. text .*;

Import java. math .*;

Public class Main

{

Public static void main (String [] args)

{

Partition cin = new partition (new BufferedInputStream (System. in ));

While (cin. hasNext ())

{

BigInteger a = cin. nextBigInteger ();

BigInteger B = cin. nextBigInteger ();

BigInteger c1 = a. add (B); // Large Number Addition

System. out. println ("the added result is" + c1 );

BigInteger c2 = a. subtract (B); // subtraction of large numbers

System. out. println ("the result of subtraction is" + c2 );

BigInteger c3 = a. multiply (B); // multiplication of large numbers

System. out. println (c3 );

BigInteger c4 = a. divide (B); // division of large numbers

SYSTEM. OUT. PRINTLN ("the result of division is" + C4 );

BIGINTEGER C5 = A. MOD (B); // Big Data Model

BIGINTEGER C5 = A. REMAINDER (B );

SYSTEM. OUT. PRINTLN ("the result of the modulo is" + C5 );

BIGINTEGER C6 = A. MAX (B); // obtain the maximum

SYSTEM. OUT. PRINTLN ("Max" + C6 );

BIGINTEGER C7 = A. MIN (B); // minimum value

SYSTEM. OUT. PRINTLN ("minimum" + C7 );

IF (A. EQUALS (B) // judge whether the values are equal

SYSTEM. OUT. PRINTLN ("Equal ");

Else system. OUT. PRINTLN ("not equal ");

BIGINTEGER C8 = A. GCD (B); // calculates the maximum approximate number.

SYSTEM. OUT. PRINTLN ("the maximum number of common appointments is" + C8 );

}

}

}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.