日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > java >内容正文

java

java math 类_Java Math类静态双层(double d)示例

發(fā)布時間:2025/3/11 java 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java math 类_Java Math类静态双层(double d)示例 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

java math 類

數(shù)學(xué)班靜態(tài)雙層(雙D) (Math Class static double floor(double d))

  • This method is available in java.lang package.

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

  • In this method if the value of the given positive argument after decimal point is 0 or greater than 0 so in that case it returns the same number before decimal point else if the value of the given negative argument after decimal point is greater than 0 so it returns (the same number +1) before decimal point.

    在此方法中,如果給定的正參數(shù)的小數(shù)點(diǎn)后的值是0或大于0,那么在這種情況下,它在小數(shù)點(diǎn)前返回相同的數(shù)字,否則,如果給定的負(fù)參數(shù)的值后小數(shù)點(diǎn)后大于0,則它在小數(shù)點(diǎn)前返回(相同的數(shù)字+1)。

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

    這是一個靜態(tài)方法,因此也可以使用類名訪問此方法。

  • The return type of this method is double that means it returns the greatest floating-point value of the given argument and the argument value may be less than or equal to the given argument.

    此方法的返回類型為double,這意味著它將返回給定參數(shù)的最大浮點(diǎn)值,并且參數(shù)值可能小于或等于給定參數(shù)。

  • In this method, we pass only one parameter as an argument in the method of Math class.

    在此方法中,我們僅將一個參數(shù)作為參數(shù)傳遞給Math類的方法。

  • This method does not throw any exception.

    此方法不會引發(fā)任何異常。

Syntax:

句法:

public static double floor(double d){}

Parameter(s):

參數(shù):

double d – A double value whose greatest floating-poin value to be found.

double d-一個雙精度值,其最大浮點(diǎn)值將被找到。

Note:

注意:

  • If we pass "NaN", it returns "NaN".

    如果我們傳遞“ NaN”,則返回“ NaN”。

  • If we pass a positive infinity, it returns the same i.e. a positive infinity.

    如果我們傳遞一個正無窮大,它將返回相同的值,即一個正無窮大。

  • If we pass a negative infinity, it returns the same i.e. a negative infinity.

    如果我們傳遞一個負(fù)無窮大,它將返回相同的值,即一個負(fù)無窮大。

  • If we pass 0 (-0 or 0), it returns the same.

    如果我們傳遞0(-0或0),則返回相同值。

Return value:

返回值:

The return type of this method is double, it returns the greatest floating-point value of the given value.

此方法的返回類型為double ,它返回給定值的最大浮點(diǎn)值。

Java程序演示floor(double d)方法的示例 (Java program to demonstrate example of floor(double d) method)

// Java program to demonstrate the example of floor(double d) // method of Math Classpublic class FloorMethod {public static void main(String[] args) {// Here we are declaring few variablesdouble d1 = 7.0 / 0.0;double d2 = -7.0 / 0.0;double d3 = 0.0;double d4 = -0.0;double d5 = -123.1;double d6 = 123.456;// Display previous value of d1,d2,d3,d4,d5 and d6 System.out.println(" Before implementing floor() so the value of d1 is :" + d1);System.out.println(" Before implementing floor() so the value of d2 is :" + d2);System.out.println(" Before implementing floor() so the value of d3 is :" + d3);System.out.println(" Before implementing floor() so the value of d4 is :" + d4);System.out.println(" Before implementing floor() so the value of d4 is :" + d5);System.out.println(" Before implementing floor() so the value of d4 is :" + d6);// Here , we will get (Infinity) because we are passing parameter // whose value is (infinity)System.out.println("After implementing floor() so the value of d1 is :" + Math.floor(d1));// Here , we will get (-Infinity) because we are passing parameter // whose value is (-infinity)System.out.println("After implementing floor() so the value of d2 is :" + Math.floor(d2));// Here , we will get (0.0) because we are passing parameter // whose value is (0.0)System.out.println("After implementing floor() so the value of d3 is :" + Math.floor(d3));// Here , we will get (-0.0) because we are passing parameter // whose value is (-0.0)System.out.println("After implementing floor() so the value of d4 is :" + Math.floor(d4));// Here , we will get (-124.0) because we are passing parameter // whose value is (-123.1)System.out.println("After implementing floor() so the value of d5 is :" + Math.floor(d5));// Here , we will get (123.0) because we are passing parameter // whose value is (123.456)System.out.println("After implementing floor() so the value of d6 is :" + Math.floor(d6));} }

Output

輸出量

E:\Programs>javac FloorMethod.javaE:\Programs>java FloorMethod Before implementing floor() so the value of d1 is :Infinity Before implementing floor() so the value of d2 is :-Infinity Before implementing floor() so the value of d3 is :0.0 Before implementing floor() so the value of d4 is :-0.0 Before implementing floor() so the value of d4 is :-123.1 Before implementing floor() so the value of d4 is :123.456After implementing floor() so the value of d1 is :Infinity After implementing floor() so the value of d2 is :-Infinity After implementing floor() so the value of d3 is :0.0 After implementing floor() so the value of d4 is :-0.0 After implementing floor() so the value of d5 is :-124.0 After implementing floor() so the value of d6 is :123.0

翻譯自: https://www.includehelp.com/java/math-class-static-double-floor-double-d-with-example.aspx

java math 類

總結(jié)

以上是生活随笔為你收集整理的java math 类_Java Math类静态双层(double d)示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 影音先锋精品 | 欧美xxxxbbbb | 欧美四区 | 欧美少妇一级片 | 成人做爰69片免费看 | 丁香色欲久久久久久综合网 | 四虎网址在线观看 | 国产亚洲成av人片在线观看桃 | 成人夜晚看av | 老熟妇高潮一区二区三区 | 久久久夜色精品 | 欧美在线影院 | 午夜精品久久久久久久91蜜桃 | 日韩午夜视频在线观看 | 国产人妻精品一区二区三区不卡 | 亚洲综合色站 | 国产精品一区二区无码免费看片 | 国产高清免费 | 美女张开双腿让男人捅 | 丁香七月婷婷 | 国产91国语对白在线 | 99中文字幕| 久热精品视频在线 | 国产成人三级在线观看 | 国产精品对白刺激久久久 | 国产青青青 | 精品一区二区三区中文字幕 | 无码一区二区三区 | 老熟妻内射精品一区 | 婷婷在线免费视频 | 国产aⅴ精品一区二区三区久久 | 草草影院地址 | 国精产品一区二区三区 | 热久久精品免费视频 | 飘花影院伦理片 | 少妇综合网 | 人妻少妇精品中文字幕av蜜桃 | 日本一区二区不卡视频 | 蜜臀久久久久久999 大陆熟妇丰满多毛xxxⅹ | 天天操天天插 | 日韩作爱 | 国产麻豆剧果冻传媒白晶晶 | 999毛片| av一区免费 | 五月激情av | 小早川怜子一区二区三区 | 欧美黄色短视频 | 天天干,天天操 | 亚洲视频大全 | 日本久久中文字幕 | 精品人妻伦一区二区三区久久 | 国产探花一区二区三区 | 中国美女一级黄色片 | 美女100%无挡 | 国产第一页在线观看 | 欧美精品在欧美一区二区少妇 | 国产一区在线视频观看 | av一区二区不卡 | 欧美极品三级 | 免费jizz | av动漫网 | 手机av在线| 草莓巧克力香氛动漫的观看方法 | 国产在线超碰 | 香蕉网在线播放 | 亚洲精品20p | 久久国产成人精品 | 国产精品久久久久无码av色戒 | 香蕉伊人网 | 带aaa级的网名 | 色臀 | 噜啪啪 | 亚洲av无码一区二区三区dv | 亚洲一区二区中文 | 人人爱人人艹 | 最新激情网站 | 99久久99久久精品国产片果冰 | 99国产精品国产免费观看 | 久久蜜桃av | 亚洲一区www | 中文字幕第八页 | 亚洲一卡二卡在线 | 人人爱爱人人 | 久久99精品久久久久久 | 免费成人av在线播放 | √资源天堂中文在线 | 国产96在线 | 亚洲 | 国产真实乱人偷精品人妻 | 国产人妖在线播放 | 后进极品美女白嫩翘臀 | 亚洲二区在线播放视频 | 激情av在线| 色呦| 国产亚洲91 | 香蕉视频亚洲一级 | 成年人黄色片网站 | 亚洲伦理中文字幕 | 久久久久久久久久影院 | 欧美激情免费视频 |