Flutter Engine
The Flutter Engine
third_party
skia
src
utils
SkFloatToDecimal.h
Go to the documentation of this file.
1
/*
2
* Copyright 2017 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef SkFloatToDecimal_DEFINED
9
#define SkFloatToDecimal_DEFINED
10
11
constexpr
unsigned
kMaximumSkFloatToDecimalLength
= 49;
12
13
/** \fn SkFloatToDecimal
14
Convert a float into a decimal string.
15
16
The resulting string will be in the form `[-]?([0-9]*\.)?[0-9]+` (It does
17
not use scientific notation.) and `sscanf(output, "%f", &x)` will return
18
the original value if the value is finite. This function accepts all
19
possible input values.
20
21
INFINITY and -INFINITY are rounded to FLT_MAX and -FLT_MAX.
22
23
NAN values are converted to 0.
24
25
This function will always add a terminating '\0' to the output.
26
27
@param value Any floating-point number
28
@param output The buffer to write the string into. Must be non-null.
29
30
@return strlen(output)
31
*/
32
unsigned
SkFloatToDecimal
(
float
value
,
char
output
[
kMaximumSkFloatToDecimalLength
]);
33
34
#endif
// SkFloatToDecimal_DEFINED
SkFloatToDecimal
unsigned SkFloatToDecimal(float value, char output[kMaximumSkFloatToDecimalLength])
Definition:
SkFloatToDecimal.cpp:73
kMaximumSkFloatToDecimalLength
constexpr unsigned kMaximumSkFloatToDecimalLength
Definition:
SkFloatToDecimal.h:11
value
uint8_t value
Definition:
fl_standard_message_codec.cc:36
dart_profiler_symbols.output
output
Definition:
dart_profiler_symbols.py:51
Generated on Sun Jun 23 2024 21:56:36 for Flutter Engine by
1.9.4