math.inc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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:fpc_in_abs_real];
  38. {$define FPC_SYSTEM_HAS_SQR}
  39. function sqr(d : extended) : extended;[internproc:fpc_in_sqr_real];
  40. {$define FPC_SYSTEM_HAS_SQRT}
  41. function sqrt(d : extended) : extended;[internproc:fpc_in_sqrt_real];
  42. {$endif}
  43. {
  44. $Log$
  45. Revision 1.12 2004-11-21 19:11:33 peter
  46. * fix bootstrapping
  47. Revision 1.11 2004/11/21 15:35:23 peter
  48. * float routines all use internproc and compilerproc helpers
  49. Revision 1.10 2004/10/03 12:41:30 florian
  50. * made sqrt, sqr and abs internal for the sparc
  51. Revision 1.9 2004/05/31 14:31:57 peter
  52. * remove comment warnings
  53. Revision 1.8 2004/01/06 21:33:38 peter
  54. * remove generic functions
  55. Revision 1.7 2003/09/14 15:02:24 peter
  56. * remove int64 to double helpers
  57. Revision 1.6 2003/09/02 17:41:49 peter
  58. * updated for int64 to double
  59. Revision 1.5 2003/09/01 20:46:32 peter
  60. * new dummies
  61. Revision 1.4 2003/04/23 21:28:21 peter
  62. * fpc_round added, needed for int64 currency
  63. Revision 1.3 2003/01/22 20:45:15 mazen
  64. * making math code in RTL compiling.
  65. *NB : This does NOT mean necessary that it will generate correct code!
  66. Revision 1.2 2003/01/20 22:21:36 mazen
  67. * many stuff related to RTL fixed
  68. Revision 1.1 2002/12/24 21:30:20 mazen
  69. - some writeln(s) removed in compiler
  70. + many files added to RTL
  71. * some errors fixed in RTL
  72. Revision 1.14 2002/11/28 11:04:16 olle
  73. * macos: refs to globals in beginasm adapted to macos
  74. Revision 1.13 2002/10/21 18:08:28 jonas
  75. * round has int64 instead of longint result
  76. Revision 1.12 2002/09/08 13:00:21 jonas
  77. * made pi an internproc instead of internconst
  78. Revision 1.11 2002/09/07 16:01:26 peter
  79. * old logs removed and tabs fixed
  80. Revision 1.10 2002/08/18 22:11:10 florian
  81. * fixed remaining assembler errors
  82. Revision 1.9 2002/08/18 21:37:48 florian
  83. * several errors in inline assembler fixed
  84. Revision 1.8 2002/08/10 17:14:36 jonas
  85. * various fixes, mostly changing the names of the modifies registers to
  86. upper case since that seems to be required by the compiler
  87. Revision 1.7 2002/07/31 16:58:12 jonas
  88. * fixed conversion from int64/qword to double errors
  89. Revision 1.6 2002/07/29 21:28:17 florian
  90. * several fixes to get further with linux/ppc system unit compilation
  91. Revision 1.5 2002/07/28 21:39:29 florian
  92. * made abs a compiler proc if it is generic
  93. Revision 1.4 2002/07/28 20:43:49 florian
  94. * several fixes for linux/powerpc
  95. * several fixes to MT
  96. }