To make a UserLib
Blitz3D Forums/Blitz3D Beginners Area/To make a UserLib
| ||
Hi Everybody :-) I'd like to make a userlib to do math with more precision. The example supplied with BlitzPlus, dllmain.cpp, uses MS Visual C++ which I don't have and cannot afford and would take too long to learn how to use. I don't know what other languages to use to produce a DLL. Are there any other versions of Basic (not MSVB) that do good math and are cheap enough and can make DLLs? |
| ||
Visual Basic DLL's aren't real dll's. PureBasic can create system dll's. It's very easy....and cheap. |
| ||
And Dev-C++... it's free and you can produce Dlls with it. http://www.bloodshed.net |
| ||
Thanks Darklordz and Jedive, I played with PureBasic but it has the same lack of math precision :-/ Dev-C++ is new to mw :-) I'll give that a go. Thanks again for the guidance ... |
| ||
@julianbury lack of math precision ??? Elaborate or Enlighten me... |
| ||
Hi, Darklordz I want to write an astronomical/scientific calculator to work planitary orbital predictions far into the future. No two circuits of an orbit are the same since each time round, all the gravitational influences are slightly different and the solar wind density fluctuates. I need to be able to input real distances in meters and velocities in fractions of a meter per second. Results are required to be extremely accurate at each step to avoid errors accumulating. Cosines must be correct to millionths of a degree. I can't afford Mathmatica so I want to write my own. The great thing about BlitzPlus is that it makes application creation quick and easy. The drawback is that it can't do two mission-critcal things: detect all keypresses in text gadgets and do accurate numbers. In C, "a long double" (which is what I need) occupies 80bits of RAM. The best Blitz can do is 32bits - nowhere near the circumference of Pluto's orbit in meters or how many seconds that would take (to the nearest second). Anyway, I've now got the latest version of Dev-C++ and I've been searching for an example of a working set of source files for a DLL. I have not so far found any and I do not know how to make a .dll file. Neither do I know how to present a string to one or how to receive a string from one. I don't suppose you could let me in on the secret? Thanks for reading this, at least :-) |
| ||
Somebody created a library for the double float whith PureBasic. You can seek on the forum, seeks "F64 - Double Floats", it can help you. |
| ||
Does anybody have some GCC code for making a DLL that takes in a string and spits out another string? I've searching for twenty hours solid. I'm beginning to feel a bit desparate. Maybe the smart guys all went on vacation this week? After all, it IS November! |
| ||
"In C, "a long double" (which is what I need) occupies 80bits of RAM." Not exactly true, it's entirely dependant on how a particular C compiler and PC system meets the standards set by the C language...basicly the C standard may state as much, but not every C compiler meets that standard...most would implament it as 64-bits as such a grouping size is much more cpu compatable. If you arn't concerned with speed...as in how fast it takes to add, subtract, multiply, divide two sets of large numbers...then you could do exactly what you are seeking in pure Blitz...how? In the older mainframe systems (like Cray super computers) a number was stored in text format with languages like FORTRAN...meaning if it was 10 digits long...it used 10 bytes..1 byte per digit...and math functions worked much like doing things by hand...the two numbers to be added, whatever were in essense rolloed out as if doing them by hand...instead of working with the whole numbaer at once, the process involved going though the number one digit at a time much like you would do math by hand (except the computer wouldn't add "5" to "1" and come up with "7")...this can be done in Blitz useing strings to hold the numbers, or even banks...but if done right you could add, subtract, multiply and even divide numbers as large as your computer has memory (it would be slow, but quite accurite...was how NASA did things) |
| ||
Hello MSW That's a lovely idea - doing it all in text. In my calculator, speed is not important so this could be an option. I would still rather make a DLL in C and maybe #pragma it to use 10byte values. I don't know if that is possible. But even 8byte doubles would be better that 4byte floats. There are other reasons, now and then, to make DLLs so I'd like to know how to do it in any case. |