Position: Home page » Ethereum » How many decimal places can Ethereum divide

How many decimal places can Ethereum divide

Publish: 2021-04-27 06:01:43
1. How many account addresses can an Ethereum node have at most
A: generally, there is only one account address, otherwise there will be an error! blockchain itself is unique. If there are multiple account addresses on one node, it violates the fundamental principle of blockchain!
2. A double type of a double type of you can't specify 100 characters after a few of 100 points. Please use bigdecimal.
public
class
class
Golnumber

<
public
public
>static
void
void
main(string []

>args)




system.out.println(gold number.getgoldnumber(5);<
}
public
static
string
getgoldnumber(int
n) {
bigdecimal
=
new
bigdecimal(0.618);< br/>bigdecimal
b
=
new
bigdecimal(" <
(int
i
=
1;

i
<< br/>n+1;<

a
=
b.divide(a.add(b),
n,
bigdecimal.round_half_up);<
}
return
a.tostring();< br/>}
}
3.

方法一:找到小数点位置然后截取
String number = "123.456";
String intNumber = number.substring(0,number.indexOf("."));
System.out.println(intNumber);

方法二:转成数字然后转换为整数再转换为字符串
Stringnumber="123.456";
System.out.println(String.valueOf(Math.floor(Double.parseDouble(number))));

方法三:用小数点分割取第一个结果:
Stringnumber="123.456";
System.out.println(number.split(".")[0]);

4. Split() php5.3 above will report an error. It is not recommended to use it. It is recommended to use expand to separate regular ones< br />
$content=explode('.&# 39;,$ content);< br />print_ r($content);
5. If it's just a number, and there must be a decimal point, you can use split text to achieve:
. Version
2
. Support library
spec
. Subroutine
_ Button 1_ Click
. Local variable
number,
text type
. Local variable
temporary text,
text type,
,
& quot; 0"
. Local variable
decimal place,
integer type
=
"1.5235"
temporary text
=
split text
(number,
".,
)
. If it is true
(take the number of array members
(temporary text)

1)
information box
(" no decimal point ",
0,
)
returns
()
. If the end is true
decimal place
=
take text length
(temporary text
[2])
debug output
("decimal place is"
+
to text
(decimal place))
6. zero point six one eight
7. The ratio is (√ 5-1): 2, and the approximate value of three decimal places is 0.618. Because the shape designed according to this proportion is very beautiful and soft, it is called golden section, also known as Sino foreign ratio.
8. The ratio is (√ 5-1): 2,
the approximate value of the three decimal places is 0.618.
because the shape designed according to this ratio is very beautiful and soft, it is called golden section, also known as Sino foreign ratio
9. This is what I wrote on the reference network. You can try it
for example: div (1,3,16); 1 / 3 means to keep 16 decimal places. If the third parameter is not written, it means to keep 2 decimal places
/ *
* Arithmetic division
* Variable parameters
*@ Paramo1 divisor
*@ Paramo2 divisor
*@ Paramo3 is optional (mainly used to reserve decimal places, if not selected, 2 digits will be reserved by default)
*@ return
*/< br /> publicstaticdoublediv(Object...o)
{< br /> Integerscale=null;< br /> BigDecimaldec1=newBigDecimal(o[0].toString());< br /> BigDecimaldec2=newBigDecimal(o[1].toString());< br /> if(o.length< 3)
scale=2;< br /> else
scale=(Integer)o[2];< br /> returndec1.divide(dec2,scale,BigDecimal.ROUND_ HALF_ UP).doubleValue();< br /> }
10. How many decimal places are there at the end of 1.710
there are three decimal places at the end of 1.710, which is the number of decimal places from the decimal point

decimal is composed of integer part, decimal part and decimal point. When measuring objects, we often get a number that is not an integer. The ancients invented decimal to supplement the integer. Decimal is a special form of decimal fraction. Fractions with denominators of 10, 100, 1000... Can be expressed as decimals. All fractions can be expressed as decimals, except infinite non cyclic decimals. An irrational number is an infinite acyclic decimal
if 0 is added or removed at the end of the decimal, the size of the decimal remains unchanged, but the counting unit changes. Moreover, if the decimal point is moved one, two or three places to the left, the original number will be reced by 10, 100 or 1000 times; if the decimal point is moved one, two or three places to the right, the original number will be increased by 10, 100 or 1000 times
we can start with the meaning of fraction. The meaning of fraction can be explained from sub segmentation and synthesis activities. When a whole (referring to the benchmark quantity) is divided equally, the quantity that gathers part of it is called "component", and "fraction" is used to express or record this "component". For example, 2 / 5 means that an integer is divided into five equal parts, and two of them are gathered together. When the whole is divided into 10 equal parts, 100 equal parts, 1000 equal parts, etc., the component at this time will use another recording method - decimal. For example, 1 / 10 is 0.1, 2 / 100 is 0.02, 5 / 1000 is 0.005, etc. The "." is called the decimal point, which is used to separate the integral part from the decimal part that cannot form an integer. If the integer is not 0, it is called with decimal. If it is 0, it is called pure decimal. Therefore, the meaning of decimal is a part of the meaning of fraction
decimal retention
decimal retention: round off the highest position of the rounding part as required

infinite non cyclic decimals can only be represented by decimals, not fractions. All finite decimals and infinite cyclic decimals can be represented by fractions. Decimals can be divided into finite decimals and infinite decimals, such as 1 / 5, Infinite decimals include infinite acyclic decimals (such as 0.010010001...) and infinite cyclic decimals (such as 1 / 3)

(rational number): the number that can be accurately expressed as the ratio of two integers.

for example, 3, - 98.11, 5.7272..., 7 / 22 are rational numbers.

integers and commonly known fractions are rational numbers, 0 and negative rational number.

in the decimal representation system of numbers, rational numbers are numbers that can be expressed as finite decimals or infinite circular decimals. This definition is also applicable in other carry systems (such as binary system).

therefore, there is no contradiction<

multiply decimal by integer:

convert decimal multiplication into integer multiplication

first, expand the decimal into an integer, and calculate according to the integer multiplication. The proct will be reced as many times as the factor is expanded

the number of decimal places of the proct is related to the number of decimal places of the multiplicand. Because if we want to convert decimal multiplication into integer multiplication, how many times the multiplicand is expanded, the multiplier is unchanged, and the proct is expanded. So we have to rece the proct by many times

to calculate the multiplication of a decimal by an integer, first calculate the proct according to the calculation method of integer multiplication, and then see how many decimal places there are in the multiplicand, count out a few decimal places from the right side of the proct, and point to the decimal point.
Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750