is there java's BigDecimal equivalent in golang ?

thanks
Santhosh

On Wed, Feb 17, 2021 at 2:05 AM Brian Candler <b.cand...@pobox.com> wrote:

> You compared Golang's BigFloat with Java's BigDecimal.  They are not the
> same.
>
> On Tuesday, 16 February 2021 at 20:30:28 UTC Santhosh T wrote:
>
>> in Java, this is not case.
>>
>>         BigDecimal v = new BigDecimal("123.4");
>>         System.out.printf("%.20f\n", v); // prints
>> 123.40000000000000000000
>>         System.out.printf("%.40f\n", v); // prints
>> 123.4000000000000000000000000000000000000000
>>
>> you can see that it is represented exactly. I thought it was the same
>> with big.Float in golang.
>>
>> thanks
>> Santhosh
>>
>>
>> On Tue, Feb 16, 2021 at 10:26 PM Brian Candler <b.ca...@pobox.com> wrote:
>>
>>> On Sunday, 14 February 2021 at 21:57:31 UTC kortschak wrote:
>>>
>>>> 123.4 cannot be represented in binary with a finite number of bits.
>>>>
>>>>
>>> See:  https://0.30000000000000004.com/
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "golang-nuts" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/golang-nuts/3t9ao7qtrlM/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> golang-nuts...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/golang-nuts/721b9ad4-32f0-4aeb-93e6-4fe757174b5dn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/golang-nuts/721b9ad4-32f0-4aeb-93e6-4fe757174b5dn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/3t9ao7qtrlM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/e2fc093f-b730-4748-85d2-f85cdec6a29bn%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/e2fc093f-b730-4748-85d2-f85cdec6a29bn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CABv5LKXTsHuetKffbHvS54V7txJdbacyTn5tnON%3DGuXVqkCemw%40mail.gmail.com.

Reply via email to