math.inc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2000 by Jonas Maebe and other members of the
  5. Free Pascal development team
  6. Implementation of mathamatical Routines (only for real)
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. {$ifdef INTERNCONSTINTF}
  14. {$define FPC_SYSTEM_HAS_ABS}
  15. function fpc_abs_real(d : valreal) : valreal;compilerproc;
  16. begin
  17. { Function is handled internal in the compiler }
  18. runerror(207);
  19. result:=0;
  20. end;
  21. {$define FPC_SYSTEM_HAS_SQR}
  22. function fpc_sqr_real(d : valreal) : valreal;compilerproc;
  23. begin
  24. { Function is handled internal in the compiler }
  25. runerror(207);
  26. result:=0;
  27. end;
  28. {$define FPC_SYSTEM_HAS_SQRT}
  29. function fpc_sqrt_real(d : valreal) : valreal;compilerproc;
  30. begin
  31. { Function is handled internal in the compiler }
  32. runerror(207);
  33. result:=0;
  34. end;
  35. {$else}
  36. {$define FPC_SYSTEM_HAS_ABS}
  37. function abs(d : extended) : extended;[internproc:in_abs_extended];
  38. {$define FPC_SYSTEM_HAS_SQR}
  39. function sqr(d : extended) : extended;[internproc:in_sqr_extended];
  40. {$define FPC_SYSTEM_HAS_SQRT}
  41. function sqrt(d : extended) : extended;[internproc:in_sqrt_extended];
  42. {$endif}
  43. {
  44. $Log$
  45. Revision 1.11 2004-11-21 15:35:23 peter
  46. * float routines all use internproc and compilerproc helpers
  47. Revision 1.10 2004/10/03 12:41:30 florian
  48. * made sqrt, sqr and abs internal for the sparc
  49. Revision 1.9 2004/05/31 14:31:57 peter
  50. * remove comment warnings
  51. Revision 1.8 2004/01/06 21:33:38 peter
  52. * remove generic functions
  53. Revision 1.7 2003/09/14 15:02:24 peter
  54. * remove int64 to double helpers
  55. Revision 1.6 2003/09/02 17:41:49 peter
  56. * updated for int64 to double
  57. Revision 1.5 2003/09/01 20:46:32 peter
  58. * new dummies
  59. Revision 1.4 2003/04/23 21:28:21 peter
  60. * fpc_round added, needed for int64 currency
  61. Revision 1.3 2003/01/22 20:45:15 mazen
  62. * making math code in RTL compiling.
  63. *NB : This does NOT mean necessary that it will generate correct code!
  64. Revision 1.2 2003/01/20 22:21:36 mazen
  65. * many stuff related to RTL fixed
  66. Revision 1.1 2002/12/24 21:30:20 mazen
  67. - some writeln(s) removed in compiler
  68. + many files added to RTL
  69. * some errors fixed in RTL
  70. Revision 1.14 2002/11/28 11:04:16 olle
  71. * macos: refs to globals in beginasm adapted to macos
  72. Revision 1.13 2002/10/21 18:08:28 jonas
  73. * round has int64 instead of longint result
  74. Revision 1.12 2002/09/08 13:00:21 jonas
  75. * made pi an internproc instead of internconst
  76. Revision 1.11 2002/09/07 16:01:26 peter
  77. * old logs removed and tabs fixed
  78. Revision 1.10 2002/08/18 22:11:10 florian
  79. * fixed remaining assembler errors
  80. Revision 1.9 2002/08/18 21:37:48 florian
  81. * several errors in inline assembler fixed
  82. Revision 1.8 2002/08/10 17:14:36 jonas
  83. * various fixes, mostly changing the names of the modifies registers to
  84. upper case since that seems to be required by the compiler
  85. Revision 1.7 2002/07/31 16:58:12 jonas
  86. * fixed conversion from int64/qword to double errors
  87. Revision 1.6 2002/07/29 21:28:17 florian
  88. * several fixes to get further with linux/ppc system unit compilation
  89. Revision 1.5 2002/07/28 21:39:29 florian
  90. * made abs a compiler proc if it is generic
  91. Revision 1.4 2002/07/28 20:43:49 florian
  92. * several fixes for linux/powerpc
  93. * several fixes to MT
  94. }