CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
convert_real_literal.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Statement List Language Conversion
4
5Author: Matthias Weiss, matthias.weiss@diffblue.com
6
7\*******************************************************************/
8
11
13
14#include <util/bitvector_types.h> // IWYU pragma: keep
15#include <util/ieee_float.h>
16
18
19constant_exprt convert_real_literal(const std::string &src)
20{
22 real.from_float(std::stof(src));
23 return real.to_expr();
24}
Pre-defined bitvector types.
A constant literal expression.
Definition std_expr.h:3117
An IEEE 754 floating-point value, including specificiation.
Definition ieee_float.h:117
constant_exprt convert_real_literal(const std::string &src)
Converts a string into the corresponding 'Real' expression.
Statement List Language Conversion.
floatbv_typet get_real_type()
Creates a new type that resembles the 'Real' type of the Siemens PLC languages.
Statement List Type Helper.