Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(15 points) Write code that that lets you know if a string is an floating point literal or not. Based on the definition from problem
(15 points) Write code that that lets you know if a string is an floating point literal or not. Based on the definition from problem 4. Single-precision floating-point format (sometimes called FP32 or float32) is a computer number format, usually occupying 32 bits in computer memory; it represents a wide dynamic range of numeric values by using a floating radix point. A floating-point variable can represent a wider range of numbers than a fixed-point variable of the same bit width at the cost of precision. A signed 32-bit integer variable has a maximum value of 2311=2,147,483,647, whereas an IEEE 754 32-bit base-2 floating-point variable has a maximum value of (2223)21273.40282351038. All integers with 7 or fewer decimal digits, and any 2n for a whole number 149n127, can be converted exactly into an IEEE 754 single-precision floating-point value. The representation of a signed real number includes an integer portion, a fractional portion, and an exponent. Use floating-point constants to represent floating-point values that can't be changed. You can omit either the digits before the decimal point (the integer portion of the value) or the digits after the decimal point (the fractional portion), but not both. You may leave out the decimal point only if you include an exponent (e|E). No white-space characters can separate the digits or characters of the constant. A floating-point constant without an f,F,l, or L suffix has type double. If the letter f or F is the suffix, the constant has type float. If suffixed by the letter I or L, it has type long double. The following examples illustrate some forms of floating-point constants and expressions: Copy 15.75L 1.575E1/=15.75/ 1575e2/=15.75/ 2.5e3F/=0.0025/ 25E4/=0.0025/
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started