![]() |
Fractal - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Gallery (https://www.boriel.com/forum/forumdisplay.php?fid=18) +---- Thread: Fractal (/showthread.php?tid=431) |
Fractal - britlion - 02-18-2012 Just for fun. Incidentally, if I change the float types to fixed, it crashes. Has something gone wrong with fixed type maths? EDIT: Updated with fixed and exit for, so if people use it here, they get the best version. Code: #define width 256 (This will take a long time. Even if you push an emulator to top speed) Re: Fractal - boriel - 02-18-2012 Awesome!!! ![]() I'll put this in the Wiki, if you don't mind, in the Examples section. :?: Re: Fractal - britlion - 02-18-2012 Course you can. (Though again - why does it seem to break with fixed, not float?) Re: Fractal - britlion - 02-18-2012 Oh - I also thought I should be able to use "end for" in the place I have "goto screen". Not sure why it refuses to compile that. Re: Fractal - boriel - 02-18-2012 It might be a bug, or might be a matter of precision. :?: Don't know. I know there's an integer version of Mandelbrot, BTW. Re: Fractal - boriel - 02-18-2012 britlion Wrote:Oh - I also thought I should be able to use "end for" in the place I have "goto screen". Not sure why it refuses to compile that.The correct syntax for that is "EXIT FOR" (this is like a Break sentence in C/C++) Re: Fractal - slenkar - 02-18-2012 quite nice ![]() Re: Fractal - britlion - 02-18-2012 boriel Wrote:britlion Wrote:Oh - I also thought I should be able to use "end for" in the place I have "goto screen". Not sure why it refuses to compile that.The correct syntax for that is "EXIT FOR" (this is like a Break sentence in C/C++) Doh! Me idiot. Yes, that works. Much better than a goto. Re: Fractal - britlion - 02-18-2012 boriel Wrote:It might be a bug, or might be a matter of precision. :?: I don't think a lack of precision should cause a restart, however... And yes. I didn't do that one ![]() Re: Fractal - britlion - 02-18-2012 slenkar Wrote:quite nice Oh slenkar! Now you've given it away ![]() Re: Fractal - boriel - 02-18-2012 britlion Wrote:A restart???boriel Wrote:It might be a bug, or might be a matter of precision. :?: Please send me the code. I would like to test it, please :?: Re: Fractal - britlion - 02-18-2012 Same code, with "FIXED" wherever DIM had "FLOAT" I could believe in it going out of bounds or something, but shouldn't just crash... Code: #define width 256 Re: Fractal - boriel - 02-25-2012 It was a bug in Fixed multiplication. Please, download release 1.2.9s789 or newer, and tell mi if it works (it did for me!). I don't see much improvement. :?: :?: :?: Can you measure the time it takes to draw the fractal with fixed variables, please? There should be some performance gain. NOTE: This release includes your MLDepacker routine (fastcalled). NOTE2: Happy Birthday! :!: :mrgreen: Re: Fractal - britlion - 02-25-2012 boriel Wrote:It was a bug in Fixed multiplication.I added a timer function to it, and grabbed the timer before and afterwards. Float: s777 : 5237.6 Seconds. s789 : 5237.9 Seconds Fixed: S789 : 2159.76 Seconds I think that's a fair speed improvement, actually.... boriel Wrote:NOTE: This release includes your MLDepacker routine (fastcalled). Nice! I added that to the library - so there's a link to the packer program in there too. You might want to tweak that to note that it's in the package. boriel Wrote:NOTE2: Happy Birthday! :!: :mrgreen: Thankee Kindly. I'm /really/ getting old now! Re: Fractal - britlion - 02-25-2012 Should be able to get it faster still using the integer method - which cheats and multiplies up decimals: DIM xl,yl as long DIM xstartl,xstepl,ystartl,ystepl as long DIM xendl,yendl as long DIM zl,zil,newzl,newzil as long #DEFINE MULTIPLIER 10000 xstartl=xstart * MULTIPLIER xendl=xend * MULTIPLIER ystartl=ystart * MULTIPLIER yendl=yend * MULTIPLIER xl = x * MULTIPLIER yl = y * MULTIPLIER Though I tried this to abject failure. Anyone else get anywhere? |