Bitcoin Forum
May 30, 2024, 03:42:49 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 ... 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 [246] 247 »
4901  Bitcoin / Development & Technical Discussion / Re: 21million BTC is just over 51 bits of precision... on: February 07, 2011, 11:20:57 PM
Floating point is not good for dealing with money.

Subtracting two Doubles on the JVM:
Code:
user> (- 0.8846 0.8524)
0.032200000000000006

Subtracting two Floats on the JVM:
Code:
user> (- (float 0.8846) (float 0.8524))
0.03219998

Neither operation got the accurate answer of 0.0322.

Why floating point is being considered at all is a mystery to me.
Those are problems with decimal fractions in floats. Tonal fractions have no such problem, nor do integer values (which I was recommending). A floating-point implementation that cannot handle all possible BitCoin values as integers, is a buggy implementation. Wink
4902  Bitcoin / Development & Technical Discussion / Re: Tonal BitCoin benefits & neutrality on: February 07, 2011, 03:00:23 PM
You (and others) need to recognize that if you want BitCoin to succeed, you must be open to ideals that don't appeal to you personally.

so if I want Bitcoin to succeed, I need to start using the character "9" to mean the quantity ten.  Hmph, I'll pass.  My kids will learn that it means nine.  Grin
No, you can use whatever you want. But at least don't oppress those who choose to use "9" to mean the quantity of 8+2. Actually, it should be a "", but "9" is tolerated and I didn't feel like having and extra "9" key somewhere for decimal. When teaching, I always make sure I do a proper "" (with a full 6-like loop) for the Tonal digit "ko".

What is all this stuff for? What's wrong on decimals? And no, I'm not American.

How many fingers do you have?
Decimal is unnatural for humans. Finger count is irrelevant. Should we use base 20 because of our toes? If you really want to count on your fingers, base 5 is better than base 10-- you can read 55 (35 decimal) that way. Or binary, then you can hit 11111111 (255 deci) without trouble (due to finger dynamics, I find it difficult to use the ring finger). I personally use binary for finger counting, each hand representing a single Tonal digit.

Can't you just fork the bitcoin client, implement tonal bit coins, and then everyone(?) who wants to use tonal can use it and we can stop having this pointless discussion. It's all binary underneath anyway, how you display the numbers is a purely cosmetic change. 
I agree, it should be. However, right now, it isn't all (simply) binary underneath. It's an encoded floating-point Decimal BitCoin value at the RPC level. This creates problems for Decimal as well, since the common decimal number of 0.1 cannot be represented by floats. But that's another topic. Smiley
4903  Bitcoin / Development & Technical Discussion / Re: Tonal BitCoin benefits & neutrality on: February 07, 2011, 04:09:45 AM
If you want to teach people what essentially amounts to counting in binary, start an education reform agenda.  Persuade teachers to teach the binary code to young children.  Until then, leave Bitcoin alone with it.  This is wholly impractical nonsense, and you should not pollute Bitcoin with it.  I think the world would benefit greatly if kids could natively count in hex, but this is a frivolous attempt to make that happen.

The purpose of Bitcoin is to offer the world a competing store of value, not to compel them to switch to count in hexadecimal and to use a foreign language for doing so.  This is a world where the vast majority of its inhabitants are completely comfortable counting in base ten.  Kudos to Satoshi for defining base-ten fractions as the de facto fraction for Bitcoin.
If you believe the "education" systems (in any country) are useful at all, you're quite frankly deluded. If anyone learns anything in them, it's because of the rare teacher who cares, or the rare student who seeks knowledge. The only real teachers are parents. I am one of those real teachers, and I am sticking to Tonal. Bitcoin is a useful to tonal users because it allows us to exchange currency in our native/preferred number system, rather than have to work in decimal for monetary exchanges (even with others who hate decimal).

Remember, Decimal BitCoin doesn't cease to exist because of Tonal BitCoin. Your irrational/fanatical oppression is not helpful. Use what you want, but let us use what we want. BitCoin can either gain the adoption of the Tonal community, or lose it by insisting we all switch to decimal (in which case, there is frankly no benefit over our local fiat currencies-- why switch at all when more people accept the fiat?). If BitCoin only appeals to the libertarian niche, it will never gain widespread adoption. You (and others) need to recognize that if you want BitCoin to succeed, you must be open to ideals that don't appeal to you personally.
4904  Bitcoin / Development & Technical Discussion / Re: [RFC] Sub-cent-precision on: February 05, 2011, 01:48:21 AM
Solution to buggy JSON libraries (with base unit amounts): append a ".0" to all amounts, even though fractions are not possible. This should force all libraries with these bugs to treat it as a floating-point type, which is capable of representing the entire range. Embedded systems where floating-point is a problem can still validly ignore the ".0" and use int64.
4905  Bitcoin / Mining / Re: OpenCL miner written in C on: February 05, 2011, 01:17:28 AM
Unpatched, this gets me 124.5 MH/s on my Radeon HD 5850. With a patch from tcatm on IRC, I got up to 259.5 MH/s. Still short of m0m's 265 MH/s, but getting closer.
4906  Bitcoin / Development & Technical Discussion / Re: bitcoind running on the N900 smartphone on: February 04, 2011, 06:32:01 AM
... make one minor change to util.cpp. The ParseHex function in util.cpp has code like:

Code:
if (c == -1)


'c' is a 'char' type which is unsigned so this comparison never does what's expected. Changing both instances of this to the following gets a working bitcoind:

Code:
if (c == (char)-1)
This "fix" seems wrong. Really, 'phexdigit' should be redefined to a 'signed char' array, and 'c'  a simple 'signed char'-- then none of this casting mess is necessary. The problem stems from the fact that the C standard allows 'char' to be either signed or unsigned: implementors can choose (and I've often see it signed). That means if you might need to use values above 127 or below 0, you must specify signed/unsigned explicitly for your variables. What (char)-1 does, is turn it into 0xff (255) on compilers that have an unsigned 'char', which might work, but it really depends a lot on how the compiler handles the constant "-1" stored in the  (undefined signedness) phexdigit array.
4907  Bitcoin / Development & Technical Discussion / Re: CMake build system on: February 03, 2011, 06:09:08 PM
I thought we were going with autotools from jgarzik?
4908  Bitcoin / Development & Technical Discussion / Re: Tonal BitCoin benefits & neutrality on: February 02, 2011, 05:33:29 AM
There is a learning curve for someone used to decimal, but given a fair comparison,  it is actually much easier in practice.
Can you point us to such a comparison? I've been trying to withhold my judgement but it's hard.
I'm not aware of any formal studies, if you mean that. The easy example I usually use is asking you, as a human, to fold a paper into 10 equal pieces without any tools to assist you in measurement; then try folding into 16 equal pieces. This demonstrates that even though you have (presumably) grown up with decimal, you can still work better with tonal in practice. If you don't want to waste 2 papers, http://www.intuitor.com/hex/switch.html has a Java applet demonstrating the same in software (but for hexadecimal, which shares this same benefit as tonal).
4909  Bitcoin / Development & Technical Discussion / Re: Tonal BitCoin benefits & neutrality on: February 01, 2011, 04:28:16 PM
Tonal system sounds pretty complicated...
Is it a base 16 system ?
How do you count to 10 or 100 (decimal) with it ?
Yes, from a decimal perspective it is base sixteen. There is a learning curve for someone used to decimal, but given a fair comparison,  it is actually much easier in practice.

Decimal012345678910111213141516
Tonal012345678910
PronunciationNollAnDeTiGoSuByRaMeNiKoHuVyLaPoFyTon
-
Decimal96979899100101102103104105106107108109110111112
Tonal6061626364656667686696666670
PronunciationBy-tonBy-ton-anBy-ton-deBy-ton-tiBy-ton-goBy-ton-suBy-ton-byBy-ton-raBy-ton-meBy-ton-niBy-ton-koBy-ton-huBy-ton-vyBy-ton-laBy-ton-poBy-ton-fyRa-ton
-
Decimal248249250251252253254255256257258259260261262263264
Tonal89100101102103104105106107108
PronunciationFy-ton-meFy-ton-niFy-ton-koFy-ton-huFy-ton-vyFy-ton-laFy-ton-poFy-ton-fySanSan-anSan-deSan-tiSan-goSan-suSan-bySan-raSan-me
4910  Bitcoin / Development & Technical Discussion / Tonal BitCoin benefits & neutrality on: February 01, 2011, 02:58:03 PM
This "Tonal Bitcoin" stuff is just stupid. "Bong-BitCoin" indeed!
Just as "stupid" as Spanish is to the ignorant American who thinks everyone should speak English. In reality, if you actually took the time to learn Tonal, you'd realize that it is in fact Decimal and SI that is truly stupid. (Yet I'm not demanding everyone drop Decimal BitCoin support just because I don't like it)

The Nystrom representation itself isn't stupid, but using it for Bitcoin is. It brings absolutely nothing worthwhile to Bitcoin.

One bitcoin is 100000000 units of bitdust, and the maximum number of bitcoins is 21000000, both of which are convenient decimal numbers. What's the point of having one Bong-Bitcoin equal to 42.94967296 BTC?

If you do want to count bitcoins in hexadecimal, you should simply use the equivalent number in base 16. For example, 255 BTC = 0xFF BTC.
More like, it brings BitCoin to the Tonal system. The Tonal system itself is also worthwhile-- but admittedly, TBC does nothing for people who are content just continuing to use Decimal (except developers, who get a method to ensure their code is properly abstracted).

One decimal BitCoin is 100,000,000 units of "bitdust", because it is a decimal unit system. The maximum number of bitcoins in decimal is in fact 20,999,999.9769, which is only convenient to round to 21 million. On the other hand, each tonal bitcoin is 1,0000 (65,536 decimal) units of "bitdust" (aka TBCᵇ), which is convenient because it is a tonal unit. The maximum tonal bitcoins is 7,750,54.00, which actually has an ending 0 unlike the decimal equivalent.

There are numerous reasons making 1 BTC = 1 TBC would be confusing and in general a bad idea:
  • It would lead people to think 10 TBC = 10 BTC, when it is in fact 16 BTC
  • It would be impossible to determine what unit system the value was intended to be used with. As defined today, there is a simple mathematical test to determine if any given number of "bitdust" represents a BTC or TBC value.
  • 1 BTC only allows for 21 million "normal" units. There are almost 7 billion people. If BitCoin ever gains widespread adoption, the present size of TBC will be much better suited for everyday spending/trading. BTC, on the other hand, will need to re-base (or else everyone will just be using μBTC instead).
  • 1 BTC is, as you stated, based on 100,000,000 base units. This is the awkward number of 55,100 base units in Tonal, and not very sensible for a Tonal unit (which are calculated in a useful way).
  • 1 BTC can only be divided into 100 Tonal units. This would make it completely unworkable when/if BitCoin reaches critical mass to require rebasing.
4911  Bitcoin / Development & Technical Discussion / Re: [RFC] Sub-cent-precision on: February 01, 2011, 02:31:06 PM
I'm splitting the Tonal talk to another thread. It doesn't belong here.

although my personal opinion is that integer units are preferable, it may or may not be worth sacrificing backward compatibility for.
Integer units don't break backward compatibility at all, if implemented using a RPC versioning mechanism (eg, bitcoin.<version>. prefix to methods, or--as MT suggested on IRC-- using a different URI path). This way, the old "RPC v0" can continue to function for as long as we care to maintain it, while new code can use RPC v1 with integer units. Given the fact that URIs are used, it might also be possible to simply use a query parameter (eg, "?precision=0", "?precision=1e8", "?precision=65536") to specify a division for all units explicitly (and default to "?precision=1e8" for backward compatibility for a while), while not forcing newer APIs to use base units.
4912  Bitcoin / Development & Technical Discussion / Re: [RFC] Sub-cent-precision on: February 01, 2011, 02:28:04 AM
We should keep the idea of using standard prefixes.

1 centibitcoin = 10^-2 BTC
1 millibitcoin = 10^-3 BTC
1 microbitcoin = 10^-6 BTC
1 nanobitcoin = 10^-9 BTC

In Satoshi's code, the smaller unit is called "the coin".  We should use this.

1 coin = 10^-8 BTC = 10 nanobitcoins

Even if the nanobitcoin is too small a unit, we can still use it, as long as we only talk about multiples of 10.  10 nanobitcoins, 40 nanobitcoins, and so on...


An other, yet compatible possibility is to start from bottom :

1 coin = 10^-8 BTC
10^3 coins = 1 kilocoin = 10^-5 BTC
10^6 coins = 1 megacoin = 10^-2 BTC
10^9 coins = 1 gigacoin = 10 BTC

So one bitcoin would actually be 0.1 gigacoin, or 100 megacoins


Either way, the bitcoin should keep being "10^8 times the smaller unit"
Please, this is about program internals, nothing that should ever be visible to the end user.

Also, we already have plenty of decimal units, no need for more. A "COIN" (in the code), is defined as 0.01 BTC (1,000,000 base units aka centi-micro-bitcoin aka bitcoin-bong). "One bitcoin" is, regardless of anything discussed here, to remain at 10^8 base units for the short-term (long-term, it's too large to be viable). "An bitcoin" is also to remain at 16^4 for the foreseeable future. Please see https://en.bitcoin.it/wiki/Units
4913  Bitcoin / Development & Technical Discussion / Re: [RFC] Sub-cent-precision on: January 31, 2011, 03:49:14 PM
This thread already existed in https://www.bitcoin.org/smf/index.php?topic=3028.0

sipa's "Idea 2" sounds exactly like "RPC v1", while gavin's "counter-proposal" sounds like "RPC v0 without rounding".

Of the voters, 3 prefer to not fix the problem at all, while 6 want it fixed. Of those 6:
- 3 want RPC v1 (base bitcoin integers; aka sipa's "Idea 2")
- 2 want RPC v0 without rounding (gavin's "counter-proposal")
- 2 voted for another (unspecified) solution (maybe sipa's "Idea 1"?)

I personally prefer RPC v1/sipa's Idea 2. This is already written in a backward-compatible form in my "neutral" branch. This way, the old/current method of centi-BTC precision BTC values can be supported by default for another N months while new code is concurrently designed for the newer API, and old code ported gradually. After that time, the default can be changed to RPC v1. After more time, especially if someone is having problems porting the old code (I'm not sure what the deprecated functions did), the older RPC v0 can be removed so as to not clutter the code for future development.

vladimir: RPC v1/sipa's Idea 2 *is* moving all APIs to centi-micro-BTCs (the low-level cannot support nano-BTC precision).
4914  Bitcoin / Development & Technical Discussion / Re: 21million BTC is just over 51 bits of precision... on: January 30, 2011, 07:04:49 PM
Problem is, "TBC" is your own invention, no matter how many times you repeat it.
No problem at all. TBC is an adaptation of the BitCoin currency to the Tonal number system, in the same way as a port of software is an adaptation to a new platform. The only problem is when people work against innovation and progress.
4915  Bitcoin / Development & Technical Discussion / Re: 21million BTC is just over 51 bits of precision... on: January 30, 2011, 06:42:26 PM
Our current interface works just fine, and all this is making a mountain out of a molehill.  I do not see the value in changing what is currently in use.
It doesn't work just fine. It is impossible to send values with sub-cent precision, and therefore also impossible to send almost any TBC coins. And just because you personally don't care about TBC is not an excuse to make life more difficult for those who do. It's no different than Windows developers trying to prevent a Linux (or Mac) port of their open source software simply by stating "it works fine for us on Windows" as an excuse to not merge patches that make it work on both platforms. The BitCoin community is growing, and not everyone is going to have the same ideals or even basic reasons for being part of the community; don't force your narrow subset of interests on everyone else whose interests might or might not overlap with yours.
4916  Bitcoin / Development & Technical Discussion / Re: 21million BTC is just over 51 bits of precision... on: January 29, 2011, 11:52:51 PM
As I said in the thread about possibly changing the ECDSA curve bitcoin uses, programmers like to solve "problems" that they know they can solve and that they think will make things a little bit better.  But, in my humble opinion, unless you're solving an important problem changing things because you think you know how is often a bad idea.

This is a perfect example:  change the RPC to spit out 64-bit integers (or move to a new RPC that spits out integers) and anybody using jansson on a 32-bit-int platform will get an overflow error.
OR, anyone using jansson would simply have to use (non-fractional) floats. As mentioned earlier, float types can represent the full range of base bitcoins fine, so long as they're not represented as decimal values.
I kind of like tcatm's suggestion to define new RPC methods that specify a base unit using strings... but then I thought more about it:

We could use scientific notation, so 1 BTC would be 1e08 base units; then if we ever needed more precision the JSON interface wouldn't change, you could just specify 1e-03 as a value....
... but that's exactly what we have now.  1 BTC is 1e00, 1 base unit is 1e-08, and if we ever needed more precision the JSON interface is ready.
1e8 is a perfectly legal JSON number. 1 BTC shouldn't be 1e00, it should be 1e8. And no matter how it is written (0.001 or 1e-03), the fractional-floating-point issues remain.

This works fine with the neutral branch: ./bitcoind -rpcversion=1 sendtoaddress 1KczVqwopWXQdFLe5sNQbpCq7yGSmXx2oo 1e8
4917  Bitcoin / Development & Technical Discussion / Re: 21million BTC is just over 51 bits of precision... on: January 29, 2011, 08:52:12 PM
...there is no reason to use floating-point rather than a simple int64...
JSON-RPC doesn't support an Integer type. So it's floating-point or string.
Actually, JSON-RPC doesn't support integer nor floating-point. It supports "number", which is not necessarily either.
4918  Bitcoin / Development & Technical Discussion / Re: 21million BTC is just over 51 bits of precision... on: January 29, 2011, 08:01:03 PM
The integer 2100000000000001 is within the range that is represented EXACTLY in double-precision floating point. On the other hand, the number 2100000.000000001 is not (and cannot be) represented exactly in double precision floating point (because it has a decimal fraction part that cannot be exactly represented in the binary encoding used for floating point).

The limit for exact integer representation in a double precision floating point number is 9,007,199,254,740,992 which is sufficient for Bitcoin's needs.
But so long as we are working in base units, there is no reason to use floating-point rather than a simple int64...
4919  Bitcoin / Development & Technical Discussion / Re: $2000-$2500 Bounty Offered on: January 29, 2011, 04:35:00 PM
UPnP is only a "security" issue if you're treating hacks like NAT as some kind of a firewall (which it's not intended to be). NAT is a hack to allow multiple computers/devices to access the WAN from a single WAN address. It isn't supposed to block anything. Blocking incoming connections has merely been a bug in the NAT implementations. UPnP fixes this bug by giving endpoints the ability to tell the router what ports it expects a connection on, so the router can correctly pass that traffic through.

If you want a firewall, go ahead and get one (or install it as software). But that is unrelated to the bug that UPnP fixes.
4920  Bitcoin / Mining / Re: Add mining functionality into FOSS games? on: January 29, 2011, 03:34:49 PM
IMO, without giving the user an informed choice in this, most people would probably consider it to be malware.
Pages: « 1 ... 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 [246] 247 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!