Bitcoin Forum
May 14, 2024, 01:43:28 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Stop using floating point!  (Read 28354 times)
racerguy
Sr. Member
****
Offline Offline

Activity: 270
Merit: 250


View Profile
February 13, 2012, 03:07:33 AM
 #21


Thanks I've been waiting over 7months to click that link.
1715651008
Hero Member
*
Offline Offline

Posts: 1715651008

View Profile Personal Message (Offline)

Ignore
1715651008
Reply with quote  #2

1715651008
Report to moderator
The block chain is the main innovation of Bitcoin. It is the first distributed timestamping system.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715651008
Hero Member
*
Offline Offline

Posts: 1715651008

View Profile Personal Message (Offline)

Ignore
1715651008
Reply with quote  #2

1715651008
Report to moderator
1715651008
Hero Member
*
Offline Offline

Posts: 1715651008

View Profile Personal Message (Offline)

Ignore
1715651008
Reply with quote  #2

1715651008
Report to moderator
1715651008
Hero Member
*
Offline Offline

Posts: 1715651008

View Profile Personal Message (Offline)

Ignore
1715651008
Reply with quote  #2

1715651008
Report to moderator
grue
Legendary
*
Offline Offline

Activity: 2058
Merit: 1431



View Profile
February 13, 2012, 03:28:59 AM
 #22

From what i can tell, bitcoinhelper (lol @ "helper") is just randomly quoting pieces of code and ranting about how we shouldn't use floats for everything. but for some reason, he didn't realize that floats are only used in GUI related stuff.

something tells me that he is either a kid who gets really hyped up about small issues (looks like he made an account just to post this topic Roll Eyes), or a troll.

and he's a necro  Angry

It is pitch black. You are likely to be eaten by a grue.

Adblock for annoying signature ads | Enhanced Merit UI
genjix
Legendary
*
expert
Offline Offline

Activity: 1232
Merit: 1076


View Profile
February 13, 2012, 04:29:54 PM
 #23

I think bitcoin using floats/doubles is frankly stupid.

https://bitcointalk.org/index.php?topic=4086.0
http://bitcoinmedia.com/merchant-developer-tutorial/
Steve
Hero Member
*****
Offline Offline

Activity: 868
Merit: 1007



View Profile WWW
February 17, 2012, 04:50:48 AM
Last edit: February 17, 2012, 02:12:11 PM by Steve
 #24

This debate is silly.  If you're really a purist, forget scaled decimal and use integers and fractions.  Smalltalk was invented in the 70's and by default, it preserves the original representation of numbers...  "1 / 2" yields a fraction with the integer 1 as the numerator and 2 as the denominator.  Multitply it by 3 and you get another fraction, "3 / 2".  Multiply that by 2 and you get the integer "3" (yes, it reduces fractions).  You don't get better precision than that.  A 64bit floating point number has plenty of precision to deal with anything bitcoin needs…try "21000000.00000002 / 2" …it works.  When working with floating point within its bounds of precision, you only need to know enough about math to know when it's appropriate to round.

(gasteve on IRC) Does your website accept cash? https://bitpay.com
2112
Legendary
*
Offline Offline

Activity: 2128
Merit: 1068



View Profile
February 17, 2012, 06:44:10 PM
 #25

This thread is very sad. Bitcoin is seriously affected with not-invented-here-itis. I personally started to think that the current milieu here is hopeless. The only hope is that the currently involved software designers fall of the face of the Earth's Internet and get replaced by a new blood.

On the other hand I also know that a lot of bright young people read this forum. So for the benefit of the young blood:

1) please learn the difference between binary floating point and decimal floating point. The good starting point is: http://speleotrove.com/decimal/

2) please compile this little C program using your recent C compiler:
Code:
#include <stdio.h>
int main()
{
        _Decimal32 x,y;

        x = 1.df;
        x /= 10.df;
        y = x;
        y *= 10.df;
        printf("%Hf %Hf\n",x,y);
        return 0;
}
For example: "gcc d.c -ldfp". If you get "library not found for -ldfp" error, then read the following and complain to your software vendor.

3) You became a collateral damage in the mortal combat between IBM and Intel. They are both pushing two incompatible implementations of decimal floating point: IBM's DPD (densely packed decimal) and Intel's BID (binary integer decimal). The libdfp code is out there on the Internet, you'll need to search for it in places that aren't easily accessible to lawyers of the two concerns that I named above.

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!