0.2.0-dev Download ZIP
47 lines ·2.3 KB Raw
| 1 | The Grisu2 algorithm is by Florian Loitsch, based on the work of Robert G. Burger and R. Kent Dybvig: |
| 2 | |
| 3 | [1] Loitsch, "Printing Floating-Point Numbers Quickly and Accurately with Integers", Proceedings of the ACM SIGPLAN 2010 Conference on Programming Language Design and Implementation, PLDI 2010 |
| 4 | [2] Burger, Dybvig, "Printing Floating-Point Numbers Quickly and Accurately", Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation, PLDI 1996 |
| 5 | |
| 6 | |
| 7 | The original C implementation is by Florian Loitsch: |
| 8 | |
| 9 | Copyright (c) 2009 Florian Loitsch |
| 10 | |
| 11 | Permission is hereby granted, free of charge, to any person |
| 12 | obtaining a copy of this software and associated documentation |
| 13 | files (the "Software"), to deal in the Software without |
| 14 | restriction, including without limitation the rights to use, |
| 15 | copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 16 | copies of the Software, and to permit persons to whom the |
| 17 | Software is furnished to do so, subject to the following |
| 18 | conditions: |
| 19 | |
| 20 | The above copyright notice and this permission notice shall be |
| 21 | included in all copies or substantial portions of the Software. |
| 22 | |
| 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
| 25 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 27 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 28 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 29 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 30 | OTHER DEALINGS IN THE SOFTWARE. |
| 31 | |
| 32 | |
| 33 | The implementation simplified and adapted to JSON and C++11 by Daniel Lemire as part of simdjson: |
| 34 | |
| 35 | Copyright 2018-2023 The simdjson authors |
| 36 | |
| 37 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 38 | you may not use this file except in compliance with the License. |
| 39 | You may obtain a copy of the License at |
| 40 | |
| 41 | http://www.apache.org/licenses/LICENSE-2.0 |
| 42 | |
| 43 | Unless required by applicable law or agreed to in writing, software |
| 44 | distributed under the License is distributed on an "AS IS" BASIS, |
| 45 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 46 | See the License for the specific language governing permissions and |
| 47 | limitations under the License. |