| 1 | #ifndef _melder_atof_h_ |
| 2 | #define _melder_atof_h_ |
| 3 | /* melder_atof.h |
| 4 | * |
| 5 | * Copyright (C) 1992-2018,2021 Paul Boersma |
| 6 | * |
| 7 | * This code is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or (at |
| 10 | * your option) any later version. |
| 11 | * |
| 12 | * This code is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 15 | * See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | /** |
| 22 | Return true if the string contains no more than a floating-point number |
| 23 | optionally surrounded by whitespace. |
| 24 | */ |
| 25 | bool Melder_isStringNumeric (conststring32 string); |
| 26 | |
| 27 | /** |
| 28 | Turn a string into a floating-point number. |
| 29 | Examples: |
| 30 | "3.14e-3" -> 3.14e-3 |
| 31 | "15.6%" -> 0.156 |
| 32 | "fghfghj" -> undefined |
| 33 | */ |
| 34 | double Melder_a8tof (conststring8 string); |
| 35 | double Melder_atof (conststring32 string); |
| 36 | |
| 37 | /* |
| 38 | Turn a string into an integer. |
| 39 | */ |
| 40 | int64 Melder_atoi (conststring32 string); |
| 41 | |
| 42 | /* End of file melder_atof.h */ |
| 43 | #endif |