Evil-Knievel
Legendary
Offline
Activity: 1260
Merit: 1170
|
 |
April 01, 2014, 09:24:06 PM |
|
where is this code?
|
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
 |
April 01, 2014, 09:25:46 PM |
|
If I did *criticize his code* then here is what he would do:
"I quit".
Then the "fan base" will say:
"James, we need you"
and he will come back without changing a line of code.
No way.What he needs now is someone who will bring up every possible mistake he made. If there is something wrong,sooner or later it will appear, we need it to happen now.You are both HUGE for the community. +1 @ james no personal attack intended james.. or anything of the sort.. if CIYAM has found a flaw then it should be mended.. even BCNext had flaws in his code that were unintended! dont take it as anything other then progression of a mutual goal! as rdanneskjoldr said you are both a huge part of this community.. also i dont know if it is a flaw or just not the best way to do something so i apologies if iv called your code flawed if it is not. ciyam has had bad experience in past with floating point now he hates floating point, he has cool demo that proves floating point is braindead anytime he sees floating point, he remembers horrible past sometimes floating point is not so bad sometimes use cases, the cool demo does not apply floating point, floats fixed point, rigid fractions must be approximated, by both floating point has error rate integers also have errors with fractions need least common denominator to use integers without errors 64 bit integers will overflow if fractions used are small enough nodecoin allocation fractions can be very small nodecoin allocation might be very big overflow cannot be avoided with 64 bit, without larger error rate than floating point 128 bit math is not in silicon errors are pretty small anyway, why risk using software library when CPU does it in silicon believe me (and CfB), or believe ciyam who has not even looked at my code that does floating point
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
 |
April 01, 2014, 09:29:07 PM Last edit: April 01, 2014, 09:44:16 PM by jl777 |
|
CIYAM didnt 'find' a flaw. The limitations and dangers of using floating point math for financial calculations have been well publicized.
Can you give a brief explanation why? wikipedia has the laymans version https://en.wikipedia.org/wiki/Floating_point#Accuracy_problemsWhile floating-point addition and multiplication are both commutative (a + b = b + a and a×b = b×a), they are not necessarily associative. That is, (a + b) + c is not necessarily equal to a + (b + c). They are also not necessarily distributive. That is, (a + b) ×c may not be the same as a×c + b×c: Like I said, this is a very well known limitation in the financial programming world. when there is a least common denominator, like cents or satoshi, integers can do errorless calculations for allocating coins from a pool, integers have errors representing fractions, especially cumulative sums of fractions you need to look at the source data to determine which has better accuracy maybe nodecoin pool calculations are not "financial program"? maybe anything that doesnt have a least common denominator, is not a "financial program"? Edit: Never using floating point seems to be like not taking full advantage of the hardware, which to me is not optimal. Just be careful, watch error rate, rounding, comparisons, etc. Yes, more work and possible to make mistakes, but this is programming, every line we write can have a bug! Again, if there is a least common denominator without overflow danger, use integers. Otherwise, need to think it through.
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
 |
April 01, 2014, 09:34:30 PM |
|
Floating-point math is heavily used for financial calculations on supercomputers. If u say that FP is bad then say this to thousands scientists who use it every day.
|
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
 |
April 01, 2014, 09:37:38 PM |
|
where is this code?
I am about a week or so away. It is straight C, almost totally self-contained. The only external libs I use are pthread, curl, and maybe zlib If you are able to review, I will be happy to send you advanced copy James
|
|
|
|
|
zero3112
|
 |
April 01, 2014, 09:41:49 PM |
|
Is there any user friendly wallet?
|
|
|
|
|
IveBeenBit
|
 |
April 01, 2014, 09:42:26 PM |
|
Floating-point math is heavily used for financial calculations on supercomputers. If u say that FP is bad then say this to thousands scientists who use it every day.
Nxt nodes forging on a Raspberry Pi is a gimmick. Someone wake me up when we have a supercomputer running Nxt. j/k This discussion has been interesting to watch. I'm looking forward to what Ian has to say when he returns to the thread.
|
|
|
|
|
|
bitcoinpaul
|
 |
April 01, 2014, 09:47:18 PM |
|
I wonder if this is kind of a religious thing. To float or not to float.
But we don't talk about Mac vs PC here. It's science, Mr. White. Science, bitch!
|
|
|
|
|
|
zero3112
|
 |
April 01, 2014, 09:48:06 PM |
|
I wonder if this is kind of a religious thing. To float or not to float.
But we don't talk about Mac vs PC here. It's science, Mr. White. Science, bitch!
Mac vs. PC?  Wait what?
|
|
|
|
|
bitcoinpaul
|
 |
April 01, 2014, 09:49:23 PM |
|
Mac vs PC is kind of a religious thing (as an example). Float vs. integer should not.
|
|
|
|
|
|
|
Evil-Knievel
Legendary
Offline
Activity: 1260
Merit: 1170
|
 |
April 01, 2014, 09:53:25 PM |
|
They should add a linux version. As it is Java, that shouldn't be a problem.
|
|
|
|
|
|
wesleyh
|
 |
April 01, 2014, 09:54:06 PM |
|
They should add a linux version. As it is Java, that shouldn't be a problem. Note that is testnet version. And linux version can be done, but I don't use java for my client tho.
|
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
 |
April 01, 2014, 09:55:47 PM |
|
I wonder if this is kind of a religious thing. To float or not to float.
But we don't talk about Mac vs PC here. It's science, Mr. White. Science, bitch!
It should be math thing, but it becomes superstition superstition not always good, even if it is good in some cases math is math, you shouldnt be able to argue with math using superstition error rate of representing 1/3 using 64 bit integer will depend on the least common denominator you use. with floating point, the hardware deals with that Now add 1/3, and a bunch of other fractions and some that are not fractions. With integer, did you use the right multiplier? Was the error rate better than floating point? Maybe it was, but unless you really know the dynamic range of your input numbers, odds are the error rate is better with floating point. So to give people the most accurate allocation of nodecoins, I decided to use floating point and make sure I didnt make any errors. Any 64 bit integer implementation would at best approach the accuracy of using 64 bit floating point, in this use case. You have to analyze each use case to know which is better to use. All things being equal, use integers. Now, the financial guys say, divide 100 pennies three ways -> 33 + 33 + 34 = 100 They are happy that it is exact. However, I feel that is unfair as one of the three got an extra penny For this, I am taking all this heat. But I cannot code any other way. I have to write what feels right to me. James
|
|
|
|
Evil-Knievel
Legendary
Offline
Activity: 1260
Merit: 1170
|
 |
April 01, 2014, 10:01:06 PM |
|
Why don't you just eliminate all this unprecise floating point arithmetic, and use fixed point instead. There are a lot of classes that do this in C, C++ and ObjC.
|
|
|
|
|
|
zero3112
|
 |
April 01, 2014, 10:12:02 PM |
|
They should add a linux version. As it is Java, that shouldn't be a problem. Java my worst nightmare. Never using this coin as soon as you said java just no. never for me.
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
 |
April 01, 2014, 10:14:24 PM |
|
Why don't you just eliminate all this unprecise floating point arithmetic, and use fixed point instead. There are a lot of classes that do this in C, C++ and ObjC.
Because for accumulating a large dynamic range of fractions, both fixed point and floating point have imprecision I prefer to trust Intel silicon, than some code library to do math. I also dont like to use external libraries if I dont have to. The more of the code I am familiar with, the more familiar I am with the code. That allows me to debug better You can test this for yourself. Sum a large number of random fractions using doubles and 64 bit ints. Tell me what gets better error rate. James
|
|
|
|
|
Sebastien256
|
 |
April 01, 2014, 10:14:54 PM |
|
@jl777 why nodecoin don't use (or need) a minimal base unit like satoshi for bitcoin? If a minimal base unit would be use for nodecoin, then exact integer arithmetic could be use.
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
 |
April 01, 2014, 10:15:57 PM |
|
They should add a linux version. As it is Java, that shouldn't be a problem. Java my worst nightmare. Never using this coin as soon as you said java just no. never for me. ?? Another superstition? Java is turing complete, so it can be turned into any other turing complete language How can the language being used be such an issue. Is Sun's JRE full of bugs?
|
|
|
|
|
bahamapascal
|
 |
April 01, 2014, 10:17:19 PM |
|
Ah, thanks for the clarification. And just while I have you here, you both did an marvelous job on the conference (have been following you over facebook etz.) !
|
|
|
|
|
|