Adding Two Numbers
Updated
Problem statement
Determine the integer floor of the sum of two floating point numbers. The floor is the truncated float value, i.e., anything after the decimal point is dropped.
Function
addNumbers(a: float, b: float) → int
Complete the function addNumbers in the editor below.
addNumbers has the following parameter(s):
float a: a floating point numberfloat b: a floating point number
Returns int: the floor of the sum of two floating point numbers
Examples
Example 1
a = 1.1b = 3.89return = 4floor(1.1 + 3.89) = floor(4.99) = 4.
Constraints
- 0.1 < a, b < 10^6
- a and b have at most 8 places after the decimal
More Oracle interview questions
- Course ScheduleONSITE INTERVIEW · Seen Nov 2026
- Shortest Subarray with Sum at Least KONSITE INTERVIEW · Seen Nov 2026
- Longest Substring Without Repeating CharactersONSITE INTERVIEW · Seen Nov 2026
- Minimum Meeting RoomsONSITE INTERVIEW · Seen Nov 2026
- Shortest Window with Required CountsONSITE INTERVIEW · Seen Nov 2026
- Maximum Subarray Sum with One DeletionONSITE INTERVIEW · Seen Nov 2026
- Shortest Deletion for Distinct CharactersONSITE INTERVIEW · Seen Nov 2026
- Count Dropped Rate-Limited RequestsONSITE INTERVIEW · Seen Nov 2026
- Remove Parentheses from a Plus-Minus ExpressionPHONE SCREEN · Seen Nov 2026
- Design Authentication ManagerONSITE INTERVIEW · Seen Oct 2026
Similar questions at other companies
- Last Digit of the Ways to Split Traders Between Two OfficesAkuna Capital · OAAkuna Capital interview questions
- Counting Cows by Their LegsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
- Summarize Taxi Drivers and RidesBoston Consulting Group · OABoston Consulting Group interview questions
- Total Cost Against the Lowest Earlier PricePayPal · OAPayPal interview questions
- Count Valid Square PairsAuxoAI · OA
- Server InvestmentRippling · OARippling interview questions
- Basic Item DiscountsPalantir · OAPalantir interview questions
- Identification Number Check DigitAbridge · OAAbridge interview questions
- Count Substrings With Identical CharactersVirtu Financial · OAVirtu Financial interview questions
- Next Pascal Row CoefficientIntuit · OAIntuit interview questions