divi模板下载_Java Math类静态double IEEEremainder(double divi,double divisor)的示例

divi模板下载

数学类静态double IEEEremainder(double divi,double divisor) (Math Class static double IEEEremainder(double divi , double divisor))

  • This method is available in java.lang package.

    此方法在java.lang包中可用。

  • This method is used to return the calculated remainder on the given two parameters.

    此方法用于返回给定两个参数上的计算余数。

  • This method is followed by IEEE 754 Standard.

    IEEE 754标准遵循此方法。

  • This is a static method so it is accessible with the class name too.

    这是一个静态方法,因此也可以使用类名进行访问。

  • This method accepts two parameters (one is dividend and other is divisor), and it returns the two numbers (one is quotient and other is remainder).

    此方法接受两个参数(一个是除数,另一个是除数),并返回两个数字(一个是商,另一个是余数)。

  • Example: Let suppose if the dividend is fully divisible by divisor then the value of the remainder will be 0 and in that case, the resultant value sign will be the same as the sign of the first argument.

    示例:假设如果除数可被除数完全除,则余数的值将为0,在这种情况下,结果值的符号将与第一个参数的符号相同。

  • The return type of this method is double that means it returns the remainder of the given arguments.

    此方法的返回类型为double,这意味着它将返回给定参数的其余部分。

  • In this method, we pass two parameters as arguments, where, the first argument represents the dividend and the second argument represents the divisor.

    在此方法中,我们将两个参数作为参数传递,其中,第一个参数表示除数,第二个参数表示除数。

  • This method does not throw any exception.

    此方法不会引发任何异常。

Syntax:

句法:

    public static double IEEEremainder(double divi, double divisor){
    }

Parameter(s):

参数:

  • divi – the value of dividend.

    股息 –股息价值。

  • divisor – the value of divisor.

    除数 – 除数的值。

Return value:

返回值:

The return type of this method is double, it returns the remainder.

此方法的返回类型为double ,它返回余数。

Note:

注意:

  • If we pass any argument "NaN", it returns the "NaN".

    如果我们传递任何参数“ NaN”,它将返回“ NaN”。

  • If we pass any argument as an infinity, it returns the "NaN".

    如果我们将任何参数传递为无穷大,它将返回“ NaN”。

  • If we pass any argument as 0 (-0 or 0), it returns the "NaN".

    如果我们将任何参数传递为0(-0或0),它将返回“ NaN”。

  • If we pass a finite value as a first argument and an infinite value as second argument, it returns the first argument.

    如果我们将一个有限值作为第一个参数传递而将一个无限值作为第二个参数传递,它将返回第一个参数。

Java程序演示IEEEremainder(double divi,double divisor)方法的示例 (Java program to demonstrate example of IEEEremainder(double divi , double divisor) method)

// Java program to demonstrate the example of 
// IEEEremainder(double divi, double divisor) method of Math Class

public class IEEEremainderMethod {
    public static void main(String[] args) {
        // variables declarations
        Double d1 = 7.0 / 0.0;
        Double d2 = 10.0;
        Double d3 = 5.0;
        Double d4 = 0.0;
        Double d5 = -0.0;

        // displaying values
        System.out.println("d1: " + d1);
        System.out.println("d2: " + d2);
        System.out.println("d3: " + d3);
        System.out.println("d4: " + d4);
        System.out.println("d5: " + d5);

        // Here , we will get (NaN) because we are passing 
        // first parameter whose value is (infinity)
        System.out.println("Math.IEEEremainder (d1,d2): " + Math.IEEEremainder(d1, d2));

        // Here , we will get (NaN) because we are passing 
        // second parameter whose value is (positive or negative 0)
        System.out.println("Math.IEEEremainder (d2,d4): " + Math.IEEEremainder(d2, d4));

        // Here , we will get (first argument) because we are passing 
        // finite parameter  as first argument whose value is (10.0) and 
        // passing infinity as second argument in the method.
        System.out.println("Math.IEEEremainder (d2,d1): " + Math.IEEEremainder(d2, d1));

        // Here , we will get (0.0) because we are passing 
        // parameter whose value is (10.0,5.0)
        System.out.println("Math.IEEEremainder (d2,d3): " + Math.IEEEremainder(d2, d3));

    }
}

Output

输出量

E:\Programs>javac HypotMethod.java

E:\Programs>java HypotMethod
d1: Infinity
d2: 10.0
d3: 5.0
d4: 0.0
d5: -0.0
Math.IEEEremainder (d1,d2): NaN
Math.IEEEremainder (d2,d4): NaN
Math.IEEEremainder (d2,d1): 10.0
Math.IEEEremainder (d2,d3): 0.0


翻译自: https://www.includehelp.com/java/math-class-static-double-ieeeremainder-double-divi-double-divisor-with-example.aspx

divi模板下载

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值