You are not logged in.
Have been rewriting my Binary/Decimal/Hexadecimal Converter from the ground up, using my "Full Precision" library.
Can you guys throw some different numbers at it to see how it performs?
Binary/Decimal/Hexadecimal Converter - Test Version
Let me know any oddities, cheers!
"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman
Offline
Hi MIF;
So far it looks pretty good.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Excellent ... so far
"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman
Offline
hi MathsIsFun
Tests out OK so far for me; whole, fractional and negative.
Bob
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
Hi MathsIsFun,
The binary/decimal/hexa-decimal converter works very well!
Excellent, MathsIsFun!
It appears to me that if one wants to make progress in mathematics, one should study the masters and not the pupils. - Niels Henrik Abel.
Nothing is better than reading and gaining more and more knowledge - Stephen William Hawking.
Offline
Thanks.
Any suggestions for improvement?
I had someone email me asking for leading zeros, but it may look OK having 0010 as a binary, but what should that be as a decimal? 02? 002?
"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman
Offline
Leading zeros:
That depends on what the user wants from the conversions. I'd have thought that spaces to make a fixed 'byte' size might be more useful; thus:
0011 0101
234 567.234 456
FFFF FFFF
0001 0101.1111 1100
023 456 789.123 456 789
000F ABCD 1234.FFFF 6767 6700
So pad out the bin and hex to blocks of 4 with zeros front and rear and the decimal in similar blocks of 3.
btw. These are 6 independent examples not 2 with conversions.
Bob
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
Hi MIF;
Maybe here is a good spot to indicate to the user a strange phenomenon that occurs in programming more than in mathematics.
If you enter .5374 in decimal you get
and
This might suggest that is the exact answer. If you carry more digits you get
and
(Pardon the lowercase letters, Mathematica thinks they are not worthy of Capitalization.)
You can continue this process because although .5374 terminates in base 10 it may not in other bases. For instance, 1 / 10 is .1 in base 10 but is non terminating in base 2. An ellipsis ... could be put to suggest that there are more digits.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Hi MIF
The converter shows strange behavior when I try to put in "1.2." in the hexadecimal box with a dot after the 2. The output is okay for the binary number, but it is weird for the decimal conversion. Maybe you should just disallow adding 2 dots altogether. The same goes for "e". Adding e's after the first changes the results.
There should also be a way to enter recurring decimals.
Otherwise, it is a very nice piece of work (like every other Flash "app" you made ).
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
A new test version needs testing: Binary/Decimal/Hexadecimal Converter - Test Version
I often get contacted by people who confuse "computer binary" (limited bits), with treating a binary number as a number. They insisting that "-1 decimal" should be "11111111 binary" (with the first bit being a sign bit), so I have tried to satisfy all comers with a drop-down box of common types.
The trouble is that it opens up many possible errors, so could you kind folk try out lots of things and tell me if they work for you?
Consider:
* positive/negative
* fractional values (like 1.1)
* changing binary, decimal or hex value
* as a number/8-bit/etc.
Cheers!
"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman
Offline
Hi MIF;
What is the difference between the menu item 0001 and number?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
0001 is supposed to pad binary with zeros to make groups of 4 (so it matches hex)
"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman
Offline
Hi;
So far the signed 8 bit is working fine. Doing more testing of the others.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Thanks for that.
"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman
Offline
Hi;
It will take some time with the 16bit signed integers and fractions.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Hi MIF;
Are you using a two's complement for your negative numbers?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Yes, I believe that is the standard in computing.
"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman
Offline
Hi;
Everything working all the way to the signed 32 bits for integers. Will keep checking and then to decimals.
I am fairly confident in the results except I have not checked negative signed 32 bit floats.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
That is really kind of you, thanks.
So it is nearly ready to go live (and replace the existing one).
"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman
Offline
Hi;
I would like to try one more thing but I will require your help. I can not find a good description of the implementation of signed 32 bit for floats like 45.567 etc. I am using everything left of the rightmost bit is inverted. Can you explain yours?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline