Author Topic: Decimals and Graphing Fractals  (Read 16690 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55918
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Decimals and Graphing Fractals
« Reply #15 on: June 26, 2010, 02:02:39 pm »
So numbers would go like

0.0
0.1
1.0
1.1
2.0
2.1

etc?

EDIT: Nvm just saw Quasi's post. It seems rather confusing to me. Something I would rather use as less as possible unless necessary
« Last Edit: June 26, 2010, 02:03:49 pm by DJ Omnimaga »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Decimals and Graphing Fractals
« Reply #16 on: June 26, 2010, 02:10:17 pm »
Yeah it's a head hurter for sure.  I might try to write a binary floating number library really quick for fun.  The main thing is that you wouldn't have to work in binary :P the program would.

And Dj, it's just like regular binary (only 1s and 0s) but you put a decimal point somewhere.  When we write binary normaly, it's at the left, we just don't write it.

101. In binary  =   5 in decimal

Buuut if we move the decimal point in the binary number to the left

10.1

we divide the value by 2, so it now has a value of 2.5 in decimal.  It's a bit tricky, but it has rules to convert to and from
« Last Edit: June 26, 2010, 02:11:24 pm by Builderboy »

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55918
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Decimals and Graphing Fractals
« Reply #17 on: June 26, 2010, 02:22:23 pm »
Yeah, well my issue was more about using it inside games. Imagine when it comes time to do complex maths and the like and you need to convert your numbers from decimal to binary or vice versa everytime. It will take so long (like when we had no sprite to hex tools, it took me about 5 minutes to make one 8x8 tile)

Offline quasi_Phthalo

  • LV3 Member (Next: 100)
  • ***
  • Posts: 90
  • Rating: +1/-1
    • View Profile
Re: Decimals and Graphing Fractals
« Reply #18 on: June 26, 2010, 02:28:20 pm »
that's true. you would need to know how to convert if you writing a game, so that you can put it in the source code. There are two options: have someone write routines to convert all necessary numbers first thing during the game's initialization so that they can still be in decimal in the source code, or someone could whip up a quick command line program to do it for you when your writing the game

Offline Michael.3545

  • LV3 Member (Next: 100)
  • ***
  • Posts: 69
  • Rating: +13/-7
    • View Profile
Re: Decimals and Graphing Fractals
« Reply #19 on: June 26, 2010, 02:29:20 pm »
When Axioms come out, this could make a great one.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Decimals and Graphing Fractals
« Reply #20 on: June 26, 2010, 02:33:46 pm »
Actuy all numbers in Axe are stored in binary to begin with (shhh don't tell anybody). Which is why base 10 floating point is so difficult (coding wise).  Binary floatig point is easier to code but harder to wrap your head around.

And I use omnicalcs base conversion feature to make all of my sprites XD

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55918
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Decimals and Graphing Fractals
« Reply #21 on: June 26, 2010, 02:45:12 pm »
I never could get Omnicalc base conversion to work before D:. It always didn't convert at all. Keep in mind the last time I tried it was in 2002, though (Omnicalc 1.0 and 1.1).

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Decimals and Graphing Fractals
« Reply #22 on: June 26, 2010, 02:47:05 pm »
The syntax is something like this

Baseconvert("Number",Base1,Base2)

i wonder if it was glitchy back then o.O I sometimes forget to put the number in quotes though

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55918
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Decimals and Graphing Fractals
« Reply #23 on: June 26, 2010, 02:49:14 pm »
IIRC the syntax was different, but I'm not sure anymore. I think you had to do something like 20h (new tokens inserted by Omnicalc)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Decimals and Graphing Fractals
« Reply #24 on: June 26, 2010, 02:52:20 pm »
Hurm maybe thats how it used to be, but its not doing that for me anymore on version 1.26

Offline quasi_Phthalo

  • LV3 Member (Next: 100)
  • ***
  • Posts: 90
  • Rating: +1/-1
    • View Profile
Re: Decimals and Graphing Fractals
« Reply #25 on: June 26, 2010, 03:16:33 pm »
well, if anyone still wants a command line program to convert decimal floating points to hex floating points, here you go. hand written by yours truly. max precision is 8 bytes after the decimal point. let me know if there's any bugs.

edit: it will crash if the input number is too long
it does not support negative numbers!:

it's up to the implementer of the floating point routines whether negatives should be one's complement of the positives, or should the msb just be flipped?
i.e.: since 32.25d = 20.40h, should -32.25d = A0.40h or DF.C0h ?
« Last Edit: June 26, 2010, 06:44:07 pm by quasi_Phthalo »

Offline yoman82

  • LV3 Member (Next: 100)
  • ***
  • Posts: 71
  • Rating: +1/-1
    • View Profile
Re: Decimals and Graphing Fractals
« Reply #26 on: June 26, 2010, 08:23:47 pm »
I'm dying for real decimal support in Axe... If someone would make an axiom, I'd be willing to take a speed hit.

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55918
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Decimals and Graphing Fractals
« Reply #27 on: June 26, 2010, 11:58:01 pm »
well, if anyone still wants a command line program to convert decimal floating points to hex floating points, here you go. hand written by yours truly. max precision is 8 bytes after the decimal point. let me know if there's any bugs.

edit: it will crash if the input number is too long
it does not support negative numbers!:

it's up to the implementer of the floating point routines whether negatives should be one's complement of the positives, or should the msb just be flipped?
i.e.: since 32.25d = 20.40h, should -32.25d = A0.40h or DF.C0h ?

The program can't start because MSVCP100.dll is missing from your computer. Try reinstalling the program to fix this problem.

Offline quasi_Phthalo

  • LV3 Member (Next: 100)
  • ***
  • Posts: 90
  • Rating: +1/-1
    • View Profile
Re: Decimals and Graphing Fractals
« Reply #28 on: June 27, 2010, 12:10:23 am »
here it is
it probably has something to do with me being on 64-bit windows 7 and using visual studio 2010
if all else fails, you could build the source yourself

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55918
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Decimals and Graphing Fractals
« Reply #29 on: June 27, 2010, 12:50:25 am »
Probably more the later, because I do not have Visual Studio installed. I got 64 bit Windows 7 too.

Also where would I put that dll file? The last time I had a similar problem, I put the OCX/dll file in the system directories (tried a bunch of them) and it still gave me the error