Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java СÊý¾«È·¼ÆËãÎÊÌâ

System.out.println(2.00 -1.10);//0.8999999999999999
ÉÏÃæµÄ¼ÆËã³öµÄ½á¹û²»ÊÇ0.9£¬¶øÊÇÒ»Á¬´®µÄСÊý¡£ÎÊÌâÔÚÓÚ1.1 Õâ¸öÊý×Ö²»Äܱ»¾«È·±íʾ
Ϊһ¸ödouble£¬Òò´ËËü±»±íʾΪ×î½Ó½üËüµÄdouble Öµ£¬¸Ã³ÌÐò´Ó2 ÖмõÈ¥µÄ¾ÍÊÇÕâ¸öÖµ£¬
µ«Õâ¸ö¼ÆËãµÄ½á¹û²¢²»ÊÇ×î½Ó½ü0.9 µÄdoubleÖµ¡£
Ò»°ãµØ˵£¬ÎÊÌâÔÚÓÚ²¢²»ÊÇËùÓеÄСÊý¶¼¿ÉÒÔÓöþ½øÖƸ¡µãÊý¾«È·±íʾ¡£
¶þ½øÖƸ¡µã¶ÔÓÚ»õ±Ò¼ÆËãÊǷdz£²»Êʺϵģ¬ÒòΪËü²»¿ÉÄܽ«1.0 ±íʾ³É10 µÄÆäËûÈκθº´Î
ÃÝ¡£
½â¾öÎÊÌâµÄµÚÒ»ÖÖ·½Ê½ÊÇʹÓûõ±ÒµÄ×îСµ¥Î»£¨·Ö£©À´±íʾ£ºSystem.out.println(200-110);//90
µÚ¶þÖÖ·½Ê½ÊÇʹÓÃBigDecimal£¬µ«Ò»¶¨ÒªÓÃBigDecimal(String)¹¹ÔìÆ÷£¬¶øǧÍò²»ÒªÓÃ
BigDecimal(double)À´¹¹Ô죨Ҳ²»Äܽ«float»òdoubleÐÍת»»³ÉStringÔÙÀ´Ê¹ÓÃBigDecimal(String)
À´¹¹Ô죬ÒòΪÔÚ½«float»òdoubleת»»³ÉStringʱ¾«¶ÈÒѶªÊ§£©¡£ÀýÈçnew BigDecimal(0.1)£¬Ëü
½«·µ»ØÒ»¸öBigDecimal£¬Ò²¼´
0.1000000000000000055511151231257827021181583404541015625£¬ÕýȷʹÓÃBigDecimal£¬³Ì
Ðò¾Í¿ÉÒÔ´òÓ¡³öÎÒÃÇËùÆÚÍûµÄ½á¹û0.9£º
System.out.println(new BigDecimal("2.0").subtract(new BigDecimal("1.10")));// 0.9
ÁíÍ⣬Èç¹ûÒª±È½ÏÁ½¸ö¸¡µãÊýµÄ´óС£¬ÒªÊ¹ÓÃBigDecimalµÄcompareTo·½·¨¡£


Ïà¹ØÎĵµ£º

flexͨ¹ýblazedsÓëjavaͨÐŵÄСÀý×Ó

ºÜ¼òµ¥µÄСÀý×Ó£¬ÊʺϳõѧÕßÀí½â
1£¬JavaFlex.java
package flex;
public class JavaFlex {
public String helloJavaFlex(String name) {
return name;
}
}

2£¬remoting-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service" class="flex.messaging.services.Remo ......

java ½âÎö¹«Ê½Àà

package test;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 * ʵÏÖ¶Ô×Ö·û´®±í´ïʽ½øÐмòµ¥µÄ°üÀ¨º¯ÊýµÄÔËËã¡£
 *
 * @auth ......

.netºÍjavaÖ®±È½Ï javaѧϰ

×î½ü¹«Ë¾Òª¿ª·¢Windowsƽ̨ÉϵIJúÆ·£¨ÓÉÓÚÉæ¼°µ½ÉÌÒµ»úÃÜ£¬ËùÒÔÄ¿Ç°ÎÞ·¨¶ÔÕâ¸ö²úÆ·×öÏêϸ½éÉÜ£©£¬²ÉÓÃ.Net¼¼Êõ½øÐпª·¢£¬ÎÒ¸ºÔðµÄÊÇ»ùÓÚ Visual Studio²å¼þ»úÖƵÄÐÐÒµ¿ª·¢¹¤¾ßµÄ¿ª·¢¡£´Ó¿ªÊ¼½Ó´¥.Netµ½ÏÖÔÚÒѾ­ÓнüÈý¸öÔÂÁË£¬¶øÇÒÒ²¿ª·¢³öÁ˵ÚÒ»¸ö°æ±¾£¬¶Ô.NetÒѾ­ÓÐÁËһЩÈÏʶ£¬ÓÉÓÚÒÔÇ°Ö÷ÒªÓÃJava¡¢PythonµÈÓïÑ ......

Java FX ±àд½Å±¾

½Å±¾±äÁ¿ÊÇʹÓà var »ò def ¹Ø¼ü×ÖÉùÃ÷µÄ¡£
¶þÕßÖ®¼äµÄÇø±ðÔÚÓÚ£ºÔڽű¾µÄÕû¸öÉúÃüÖÜÆÚÄÚ¶¼¿ÉÒÔΪ var ±äÁ¿¸³ÓèÐÂÖµ£¬
¶ø def ±äÁ¿ÔÚ±»Ê״θ³ÓèÐÂÖµºó½«±£³Ö²»±ä£»
def numOne = 100;
def numTwo = 2;
var result;
add();
subtract();
multiply();
divide();
function add() {
result = numOne + numTwo; ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ