Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
ae42def6
"...composable_kernel_rocm.git" did not exist on "bf1912ed3d00466f89d280b2dd56ab9447216b0d"
Commit
ae42def6
authored
Apr 13, 2013
by
Jesse Beder
Browse files
Merge to fix default precision for floats.
parents
434c6a56
e0ae477b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/emitterstate.cpp
src/emitterstate.cpp
+4
-4
No files found.
src/emitterstate.cpp
View file @
ae42def6
...
@@ -19,8 +19,8 @@ namespace YAML
...
@@ -19,8 +19,8 @@ namespace YAML
m_seqFmt
.
set
(
Block
);
m_seqFmt
.
set
(
Block
);
m_mapFmt
.
set
(
Block
);
m_mapFmt
.
set
(
Block
);
m_mapKeyFmt
.
set
(
Auto
);
m_mapKeyFmt
.
set
(
Auto
);
m_floatPrecision
.
set
(
6
);
m_floatPrecision
.
set
(
std
::
numeric_limits
<
float
>::
digits10
+
1
);
m_doublePrecision
.
set
(
1
5
);
m_doublePrecision
.
set
(
std
::
numeric_limits
<
double
>::
digits10
+
1
);
}
}
EmitterState
::~
EmitterState
()
EmitterState
::~
EmitterState
()
...
@@ -367,7 +367,7 @@ namespace YAML
...
@@ -367,7 +367,7 @@ namespace YAML
bool
EmitterState
::
SetFloatPrecision
(
int
value
,
FmtScope
::
value
scope
)
bool
EmitterState
::
SetFloatPrecision
(
int
value
,
FmtScope
::
value
scope
)
{
{
if
(
value
<
0
||
value
>
std
::
numeric_limits
<
float
>::
digits10
)
if
(
value
<
0
||
value
>
std
::
numeric_limits
<
float
>::
digits10
+
1
)
return
false
;
return
false
;
_Set
(
m_floatPrecision
,
value
,
scope
);
_Set
(
m_floatPrecision
,
value
,
scope
);
return
true
;
return
true
;
...
@@ -375,7 +375,7 @@ namespace YAML
...
@@ -375,7 +375,7 @@ namespace YAML
bool
EmitterState
::
SetDoublePrecision
(
int
value
,
FmtScope
::
value
scope
)
bool
EmitterState
::
SetDoublePrecision
(
int
value
,
FmtScope
::
value
scope
)
{
{
if
(
value
<
0
||
value
>
std
::
numeric_limits
<
double
>::
digits10
)
if
(
value
<
0
||
value
>
std
::
numeric_limits
<
double
>::
digits10
+
1
)
return
false
;
return
false
;
_Set
(
m_doublePrecision
,
value
,
scope
);
_Set
(
m_doublePrecision
,
value
,
scope
);
return
true
;
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment