Dear experts! Tell me please. I need to use the arcsin function in delphi (creating Win32 applications), but for this I need the math module, which I don’t have. I saw on one of the forums that you can use the library from Windows with mathematical formulas, but for some reason the method proposed there does not work. Tell me how this can be done or there is another solution to the problem. Thanks in advance to all the answers. Sincerely, Marat.

  • That is, you want to say if you write in the program uses Math , it does not compile? - Nofate
  • Yes, exactly, in my version of the math module is not. - Marat Usmanov
  • And what is your version, if not secret? - Nofate
  • This is at least extremely strange. math is always there. On behalf of the administrator tried to run? - Nofate
  • I found this post: In Delphi, the Math module comes only with the Enterprise version of the program. The solution is to borrow the Math module from the pirated Enterpise version, but this is a theft. To create a mathematical library from scratch is a thankless task. Not working tightly on MSVC, I was not aware of the presence of the crtdll.dll library in Windows (as far as I was able to figure out, it is part of the operating system, at least it comes with Win 9x / NT / 2000. You can solve this problem by using a ready-made solution - declare all the necessary functions from math.h in his program - Marat Usmanov

2 answers 2

In general, one-time can do with this:

 function ArcSin(const X : Single) : Single; asm fld1 fld X fst st(2) fmul st(0), st(0) fsubp fsqrt fpatan end; 

    Why write the whole math library if you only need arcsine? Suffice it to recall the school course of mathematics (or see here )

     fuction arcsin( const Number : Extended ) : Extended; begin result := arctan(Number/(sqrt(1-sqr(Number)))); end; 

    And all business. And you can spy here .

    • Get involved in the math algorithm ??? And also, specify which quarters of the conversation? What signs? Maybe you should still read at least basic formulas on Wikipedia? - KoVadim
    • I meant a quarter of the sin and tg functions, I deleted the comment because I found a huge error in it, and not only in it but in all my algorithm. Thank you for bringing me to this idea !!! - Marat Usmanov
    • Fuh carried in the algorithm there is no error. And trigonometry must be remembered, with this I agree with you. - Marat Usmanov