© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
66 replies
Merineth

✅ Addition with integers and floating point numbers

namespace Calculator.Model
{
    // The class for Addition "+".
    public class Addition
    {
        public static int Add(int number1, int number2)
        {

        }
    }
}
namespace Calculator.Model
{
    // The class for Addition "+".
    public class Addition
    {
        public static int Add(int number1, int number2)
        {

        }
    }
}


If i were to create this method, and someone would use a floating point number instead of an int. Would this method break? And if so, is there a way around this?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

ASP.NET Web API doesn't parse floating numbers with a '.'
C#CC# / help
3y ago
❔ playing with Lists and numbers
C#CC# / help
4y ago
c# addition and subtraction with while loop
C#CC# / help
16mo ago
✅ Switch pattern matching with integers
C#CC# / help
3y ago