Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow NaN values to pass floating point bounds check. #167

Merged
merged 13 commits into from
Aug 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rosidl_generator_py/resource/_msg.py.em
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,14 @@ bound = 2**nbits
name = "float"
bound = 3.402823e+38
}@
all(val >= -@(bound) and val <= @(bound) for val in value)), \
not any(val < -@(bound) or val > @(bound) for val in value)), \
oysstu marked this conversation as resolved.
Show resolved Hide resolved
@{assert_msg_suffixes.append('and each float in [%f, %f]' % (-bound, bound))}@
@[ elif type_.typename == "double"]@
@{
name = "double"
bound = 1.7976931348623157e+308
}@
all(val >= -@(bound) and val <= @(bound) for val in value)), \
not any(val < -@(bound) or val > @(bound) for val in value)), \
@{assert_msg_suffixes.append('and each double in [%f, %f]' % (-bound, bound))}@
@[ end if]@
@[ else]@
Expand Down Expand Up @@ -569,7 +569,7 @@ name = "double"
bound = 1.7976931348623157e+308
}@
@[ end if]@
assert value >= -@(bound) and value <= @(bound), \
assert not (value < -@(bound) or value > @(bound)), \
oysstu marked this conversation as resolved.
Show resolved Hide resolved
"The '@(member.name)' field must be a @(name) in [@(-bound), @(bound)]"
@[ end if]@
@[ else]@
Expand Down