float128.pp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2007 by the FPC development time
  4. Implements overloaded operators and misc. functions to
  5. provide a float128 type
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. unit float128;
  13. interface
  14. uses
  15. softfpu;
  16. operator+ (const f1,f2 : float128) result : float128;inline;
  17. operator* (const f1,f2 : float128) result : float128;inline;
  18. operator- (const f1,f2 : float128) result : float128;inline;
  19. operator/ (const f1,f2 : float128) result : float128;inline;
  20. operator :=(const source : double) dest : float128;inline;
  21. operator :=(const source : float128) dest : double;inline;
  22. implementation
  23. operator+ (const f1,f2 : float128) result : float128;inline;
  24. begin
  25. result:=float128_add(f1,f2);
  26. end;
  27. operator* (const f1,f2 : float128) result : float128;inline;
  28. begin
  29. result:=float128_mul(f1,f2);
  30. end;
  31. operator- (const f1,f2 : float128) result : float128;inline;
  32. begin
  33. result:=float128_sub(f1,f2);
  34. end;
  35. operator/ (const f1,f2 : float128) result : float128;inline;
  36. begin
  37. result:=float128_div(f1,f2);
  38. end;
  39. operator :=(const source : double) dest : float128;inline;
  40. begin
  41. dest:=float64_to_float128(source);
  42. end;
  43. operator :=(const source : float128) dest : double;inline;
  44. begin
  45. dest:=float128_to_float64(source);
  46. end;
  47. end.