Skip to content

Commit 27d24da

Browse files
committed
Standardize on "floating-point" rather than "floating point"
1 parent 3c7f6db commit 27d24da

File tree

9 files changed

+38
-38
lines changed

9 files changed

+38
-38
lines changed

bench/util/table.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class Table
169169

170170
/**
171171
* Helper to determine if a numeric value is zero (if integral), or close enough to zero (if
172-
* floating point).
172+
* floating-point).
173173
*
174174
* @tparam T The numeric type of the value to test.
175175
*

fly/fly.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ constexpr bool supports_consteval()
163163
}
164164

165165
/**
166-
* Compile-time helper function to determine if floating point charconv operations (std::from_chars,
166+
* Compile-time helper function to determine if floating-point charconv operations (std::from_chars,
167167
* std::to_chars) are supported.
168168
*
169-
* @return True if the compiler supports floating point charconv operations.
169+
* @return True if the compiler supports floating-point charconv operations.
170170
*/
171171
constexpr bool supports_floating_point_charconv()
172172
{

fly/types/json/json.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ namespace fly {
7878
*
7979
* A JSON boolean, number, or null value may be created from analogous C++ plain-old-data types.
8080
* Internally, 64-bit integers are used for storing integer numbers and long doubles for
81-
* floating point numbers. The signedness of the 64-bit integer is the same as the integer from
81+
* floating-point numbers. The signedness of the 64-bit integer is the same as the integer from
8282
* which the JSON value is created. For example:
8383
*
8484
* fly::Json json = true;
@@ -145,7 +145,7 @@ namespace fly {
145145
* convert based on whether the value is empty. JSON numbers will convert based on whether
146146
* the value is non-zero. Null JSON values always convert to false.
147147
*
148-
* JSON numbers may be converted to any numeric type. For example, a floating point JSON
148+
* JSON numbers may be converted to any numeric type. For example, a floating-point JSON
149149
* value may be converted to an integer.
150150
*
151151
* Lastly, this class defines the canonical interfaces of STL container types. This includes element
@@ -276,13 +276,13 @@ class Json
276276
Json(T value) noexcept;
277277

278278
/**
279-
* Floating point constructor. Intializes the Json instance to a floating point value. The
280-
* SFINAE declaration allows construction of a floating point value from any floating point type
279+
* Floating-point constructor. Intializes the Json instance to a floating-point value. The
280+
* SFINAE declaration allows construction of a floating-point value from any floating-point type
281281
* (e.g. float, double).
282282
*
283-
* @tparam T The floating point type.
283+
* @tparam T The floating-point type.
284284
*
285-
* @param value The floating point value.
285+
* @param value The floating-point value.
286286
*/
287287
template <typename T, enable_if<JsonTraits::is_floating_point<T>> = 0>
288288
Json(T value) noexcept;
@@ -1335,9 +1335,9 @@ class Json
13351335
* Equality operator. Compares two Json instances for equality. They are equal if one of the
13361336
* following is true:
13371337
*
1338-
* 1. One of the two JSON types are floating point, the other is a numeric type (signed,
1338+
* 1. One of the two JSON types are floating-point, the other is a numeric type (signed,
13391339
* unsigned, or float) and have approximately the same value after converting both types to
1340-
* floating point. Approximation is determined by comparing the difference between the two
1340+
* floating-point. Approximation is determined by comparing the difference between the two
13411341
* values to the machine epsilon.
13421342
* 2. The two Json instances are an integer type (signed or unsigned) and have the same value
13431343
* after converting the second Json value to the same type as the first Json value.

fly/types/string/detail/converter.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ namespace fly::detail {
1212
/**
1313
* Helper struct to convert a std::string to a plain-old-data type, e.g. int or float.
1414
*
15-
* Ideally, this entire helper can be removed when the STL supports floating point types with
15+
* Ideally, this entire helper can be removed when the STL supports floating-point types with
1616
* std::from_chars. However, only integral types are currently supported. Thus, integral types will
17-
* use std::from_chars, and floating point types will use the std::stof family of functions.
17+
* use std::from_chars, and floating-point types will use the std::stof family of functions.
1818
*
1919
* https://en.cppreference.com/w/cpp/compiler_support
2020
*

fly/types/string/detail/format_specifier.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace fly::detail {
5555
* Integral types - If binary, octal, or hexadecimal presentation types are used, the
5656
* alternate form inserts 0b, 0, or 0x prefixes, respectively, before the value.
5757
*
58-
* Floating point types - A decimal point character will always be inserted even if no digits
58+
* Floating-point types - A decimal point character will always be inserted even if no digits
5959
* follow it.
6060
*
6161
* 4. A zero-padding indicator (a literal "0" character). If present, the value is padded with
@@ -70,15 +70,15 @@ namespace fly::detail {
7070
*
7171
* String types - precision specifies the maxiumum number of characters to be used.
7272
*
73-
* Floating point types - precision specifies the formatting precision.
73+
* Floating-point types - precision specifies the formatting precision.
7474
*
7575
* 7. A locale-specific form indicator (a literal "L" character). It may only be used for the
7676
* following value types:
7777
*
7878
* Integral types - locale-specific form inserts appropriate digit group separator
7979
* characters.
8080
*
81-
* Floating point types - locale-specific form inserts appropriate digit group and radix
81+
* Floating-point types - locale-specific form inserts appropriate digit group and radix
8282
* separator characters.
8383
*
8484
* Boolean types - locale-specific form uses the appropriate string for textual
@@ -95,7 +95,7 @@ namespace fly::detail {
9595
*
9696
* Integral types - Valid presentations: none, "c", b", "B", "o", "d", "x", "X".
9797
*
98-
* Floating point types - Valid presentations: none, "a", A", "e", "E", "f", "F", "g", "G".
98+
* Floating-point types - Valid presentations: none, "a", A", "e", "E", "f", "F", "g", "G".
9999
*
100100
* Boolean types - Valid presentations: none, "c", s", b", "B", "o", "d", "x", "X".
101101
*
@@ -316,7 +316,7 @@ struct BasicFormatSpecifier
316316
* Parse the precision argument of the replacement field.
317317
*
318318
* It is an error the precision was specified, but the type of the corresponding format
319-
* parameter is not a string or floating point type.
319+
* parameter is not a string or floating-point type.
320320
*
321321
* It is an error if a decimal was parsed and was not followed by a non-negative precision or a
322322
* replacement field.
@@ -337,7 +337,7 @@ struct BasicFormatSpecifier
337337
* Parse the optional locale-specific form of the replacement field.
338338
*
339339
* It is an error the locale-specific form was specified, but the type of the corresponding
340-
* format parameter is not an integral, floating point, or boolean type.
340+
* format parameter is not an integral, floating-point, or boolean type.
341341
*
342342
* @param context The context holding the format string parsing state.
343343
*/
@@ -708,7 +708,7 @@ constexpr void BasicFormatSpecifier<CharType>::validate(FormatParseContext &cont
708708
if ((parameter_type != ParameterType::String) &&
709709
(parameter_type != ParameterType::FloatingPoint))
710710
{
711-
context.on_error("Precision may only be used for string and floating point types");
711+
context.on_error("Precision may only be used for string and floating-point types");
712712
}
713713
else if (m_precision_position)
714714
{
@@ -777,7 +777,7 @@ constexpr void BasicFormatSpecifier<CharType>::validate_type(
777777
(m_type != Type::General))
778778
{
779779
context.on_error(
780-
"Floating point types must be formatted with {} or one of {:aAeEfFgG}");
780+
"Floating-point types must be formatted with {} or one of {:aAeEfFgG}");
781781
}
782782
}
783783
else if (parameter_type == ParameterType::Boolean)

fly/types/string/formatters.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ struct Formatter<T, CharType, fly::enable_if<std::is_floating_point<T>>>
234234
explicit Formatter(FormatSpecifier &&specifier) noexcept;
235235

236236
/**
237-
* Format a single replacement field with the provided floating point value.
237+
* Format a single replacement field with the provided floating-point value.
238238
*
239-
* Currently, not all major compilers support std::to_chars for floating point values. If it is
239+
* Currently, not all major compilers support std::to_chars for floating-point values. If it is
240240
* supported by the compiler, then std::to_chars is used for the conversion, and the result is
241241
* further formatted according to the replacement field specification. If it is not supported,
242242
* an IO stream is used to format the value.
@@ -255,7 +255,7 @@ struct Formatter<T, CharType, fly::enable_if<std::is_floating_point<T>>>
255255
#if defined(FLY_COMPILER_SUPPORTS_FP_CHARCONV)
256256

257257
/**
258-
* Structure to hold the information needed to fully format a floating point value as a string.
258+
* Structure to hold the information needed to fully format a floating-point value as a string.
259259
*/
260260
struct FloatConversionResult
261261
{
@@ -266,15 +266,15 @@ struct Formatter<T, CharType, fly::enable_if<std::is_floating_point<T>>>
266266
};
267267

268268
/**
269-
* Convert a floating point value to a string.
269+
* Convert a floating-point value to a string.
270270
*
271-
* Internally, std::to_chars is used for the conversion, which does not handle all floating
272-
* point formatting options, such as alternate form. So rather than creating a fully-formatted
273-
* string, this method returns a structure holding the information needed to format the value as
274-
* a string.
271+
* Internally, std::to_chars is used for the conversion, which does not handle all
272+
* floating-point formatting options, such as alternate form. So rather than creating a
273+
* fully-formatted string, this method returns a structure holding the information needed to
274+
* format the value as a string.
275275
*
276276
* @param value The value to convert.
277-
* @param precision The floating point precision to use.
277+
* @param precision The floating-point precision to use.
278278
*
279279
* @return A structure holding the information needed to fully format the value as a string.
280280
*/

test/types/string/converter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ CATCH_TEMPLATE_TEST_CASE("Converter", "[string]", char, wchar_t, char8_t, char16
315315
CATCH_CHECK_FALSE(BasicString::template convert<std::uint64_t>(s));
316316
}
317317

318-
CATCH_SECTION("Convert a string to a floating point decimal")
318+
CATCH_SECTION("Convert a string to a floating-point decimal")
319319
{
320320
string_type s;
321321

test/types/string/format.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ CATCH_TEMPLATE_TEST_CASE("Format", "[string]", char, wchar_t, char8_t, char16_t,
306306
test_format(FMT("{:#X}"), FMT("0X1"), 1);
307307
}
308308

309-
CATCH_SECTION("Alternate form preserves decimal for floating point types")
309+
CATCH_SECTION("Alternate form preserves decimal for floating-point types")
310310
{
311311
test_format(FMT("{:#.0g}"), FMT("1."), 1.0);
312312
}
@@ -387,7 +387,7 @@ CATCH_TEMPLATE_TEST_CASE("Format", "[string]", char, wchar_t, char8_t, char16_t,
387387
test_format(FMT("{:3}"), FMT("123456"), 123456);
388388
}
389389

390-
CATCH_SECTION("Precision value sets floating point precision")
390+
CATCH_SECTION("Precision value sets floating-point precision")
391391
{
392392
test_format(FMT("{:.3f}"), FMT("1.000"), 1.0);
393393
test_format(FMT("{:.2f}"), FMT("3.14"), 3.14159);
@@ -429,7 +429,7 @@ CATCH_TEMPLATE_TEST_CASE("Format", "[string]", char, wchar_t, char8_t, char16_t,
429429
test_format(FMT("{:.0s}"), FMT(""), FLY_STR(char_type, "abcdef"));
430430
}
431431

432-
CATCH_SECTION("Precision position sets floating point precision")
432+
CATCH_SECTION("Precision position sets floating-point precision")
433433
{
434434
test_format(FMT("{:.{}f}"), FMT("1.000"), 1.0, 3);
435435
test_format(FMT("{0:.{1}f}"), FMT("3.14"), 3.14159, 2);

test/types/string/format_string.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ constexpr const char *s_bad_width_position = "Position of width parameter must b
129129
constexpr const char *s_missing_precision =
130130
"Expected a non-negative precision or nested replacement field after decimal";
131131
constexpr const char *s_bad_precision =
132-
"Precision may only be used for string and floating point types";
132+
"Precision may only be used for string and floating-point types";
133133
constexpr const char *s_bad_precision_position =
134134
"Position of precision parameter must be an integral type";
135135
constexpr const char *s_bad_locale =
@@ -141,7 +141,7 @@ constexpr const char *s_bad_pointer = "Pointer types must be formatted with {} o
141141
constexpr const char *s_bad_integer =
142142
"Integral types must be formatted with {} or one of {:cbBodxX}";
143143
constexpr const char *s_bad_float =
144-
"Floating point types must be formatted with {} or one of {:aAeEfFgG}";
144+
"Floating-point types must be formatted with {} or one of {:aAeEfFgG}";
145145
constexpr const char *s_bad_bool = "Boolean types must be formatted with {} or one of {:csbBodxX}";
146146

147147
#endif
@@ -837,7 +837,7 @@ CATCH_TEMPLATE_TEST_CASE(
837837
test_error(make_format(FMT("{:.-1}"), 1), s_missing_precision);
838838
}
839839

840-
CATCH_SECTION("Precision value only valid for string and floating point types")
840+
CATCH_SECTION("Precision value only valid for string and floating-point types")
841841
{
842842
test_error(make_format(FMT("{:.1}"), 1), s_bad_precision);
843843
}
@@ -848,7 +848,7 @@ CATCH_TEMPLATE_TEST_CASE(
848848
test_error(make_format(FMT("{0:.{1}}"), s, s), s_bad_precision_position);
849849
}
850850

851-
CATCH_SECTION("Precision position only valid for string and floating point types")
851+
CATCH_SECTION("Precision position only valid for string and floating-point types")
852852
{
853853
test_error(make_format(FMT("{:.{}}"), 1, 1), s_bad_precision);
854854
test_error(make_format(FMT("{0:.{1}}"), 1, 1), s_bad_precision);

0 commit comments

Comments
 (0)