Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
examples/ | H | 15-May-2021 | - | 11,779 | 10,999 | |
src/ | H | 15-May-2021 | - | 3,828 | 2,562 | |
Makefile | H A D | 03-May-2022 | 63.6 KiB | 2,530 | 2,526 | |
Makefile.fpc | H A D | 13-May-2021 | 3.8 KiB | 103 | 82 | |
Makefile.fpc.fpcmake | H A D | 13-May-2021 | 301 | 33 | 23 | |
fpmake.pp | H A D | 03-May-2022 | 771 | 40 | 31 | |
readme | H A D | 15-Sep-2009 | 2.7 KiB | 91 | 66 |
readme
1Readme for libgmp.tar.bz2 2009-09-06 2 3= What 4 5 Free Pascal interface for the GNU Multiple Precision Arithmetic Library. 6 7= Why 8 9 Numeric computing outside the built in types range. AFAIK there is no complete 10 binding for Free Pascal available yet. 11 12= Files 13 14 - gmp_accept_test.pas 15 "Go/no go" test of the gmp unit against the GMP library on your system. 16 17 - gmp.pas 18 The interface unit. 19 20 - gmp_testcase.pas 21 Put this unit in your uses clause of a fpcunit project. 22 23 - gmp_test_impl.inc 24 - gmp_test_intf.inc 25 Test classes declarations and implementations. Included by: 26 * gmp_accept_test.pas 27 * gmp_testcase 28 29 - pidigits_example.pas 30 Original source from: 31 shootout.alioth.debian.org/u64/benchmark.php?test=pidigits&lang=fpascal&id=2 32 Adapted for using the gmp unit. 33 34 - pidigits_example2.pas 35 Modified pidigits_example.pas to demonstrate usage of the gmp extensions. 36 37 - printf_example.pas 38 Demo using the GMP printf 39 40 - printf_example2.pas 41 Dtto with gmp extensions. 42 43 - scanf_example.pas 44 Demo using the GMP scanf. 45 46 - scanf_example2.pas 47 Dtto with gmp extensions. 48 49= Status 50 - Tested on 64 and 32 bit Linux and on 32 bit Windows. 51 - Known issues 52 * There is a link error on Windows with the GMP global variables. 53 Probably could be solved with someone's better knowledge of the Windows 54 environment. 55 56= Bindings 57 - Standard 58 * Almost full (see comments in gmp.pas) binding of the types and functions 59 exported from libgmp. 60 61 - Extensions 62 * Based on pseudo value types (in fact interface types) with an automatic 63 memory management in the spirit of Object Pascal strings - compiler takes 64 care of initialization/finalization. Copy on write semantics. Can intermix 65 the standard binding/types with the extended ones. The extended types have 66 access to a same set of numeric functions as in the standard binding. 67 68 - Operators 69 * Overloaded operators for the extensions value types. Can make programs 70 significantly more readable/maintainable. See and compare for yourself 71 in the pidigits examples. BTW, the overhead in this example with 72 the extended types and operators is less than 10%. Unusable for shootout, 73 but is probably acceptable in many other areas. 74 75= Tips 76 - range checks 77 You should probably want to put asserts with *_fits before conversion to 78 FPC ordinal types - applies to the assignment operator too. 79 80= License 81 - FPC developers, you can do anything you see appropriate with the sources. 82 Review, refactor and/or reject :-) 83 84= Windows 85 86I got the examples running under win32 by getting the mingw-dynamic package 87on 88 89http://cs.nyu.edu/exact/core/gmp/ 90 91and then renaming it to gmp.dll