Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

Login

Username

Password

Not registered yet?

#1 2012-09-09 08:36:42

MathsIsFun
Administrator

Offline

Binary/Decimal/Hexadecimal Converter Testing

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
 

#2 2012-09-09 08:50:30

bobbym
Administrator

Offline

Re: Binary/Decimal/Hexadecimal Converter Testing

Hi MIF;

So far it looks pretty good.


In mathematics, you don't understand things. You just get used to them.
Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means.
90% of mathematicians do not understand 90% of currently published mathematics.
 

#3 2012-09-09 14:59:05

MathsIsFun
Administrator

Offline

Re: Binary/Decimal/Hexadecimal Converter Testing

Excellent ... so far smile


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman
 

#4 2012-09-09 17:55:19

bob bundy
Moderator

Offline

Re: Binary/Decimal/Hexadecimal Converter Testing

hi MathsIsFun

Tests out OK so far for me;  whole, fractional and negative.

smile smile smile

Bob


You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
 

#5 2012-09-09 18:24:03

ganesh
Moderator

Offline

Re: Binary/Decimal/Hexadecimal Converter Testing

Hi MathsIsFun,

The binary/decimal/hexa-decimal converter works very well!

Excellent, MathsIsFun!


Character is who you are when no one is looking.
 

#6 2012-09-09 22:08:30

MathsIsFun
Administrator

Offline

Re: Binary/Decimal/Hexadecimal Converter Testing

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
 

#7 2012-09-09 22:39:45

bob bundy
Moderator

Offline

Re: Binary/Decimal/Hexadecimal Converter Testing

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.  smile

Bob


You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
 

#8 2012-09-10 00:52:05

bobbym
Administrator

Offline

Re: Binary/Decimal/Hexadecimal Converter Testing

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.
Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means.
90% of mathematicians do not understand 90% of currently published mathematics.
 

#9 2012-09-10 01:26:29

anonimnystefy
Real Member

Offline

Re: Binary/Decimal/Hexadecimal Converter Testing

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 smile ).


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“A secret's worth depends on the people from whom it must be kept.” ― Carlos Ruiz Zafón
 

Board footer

Powered by FluxBB