DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    James Knowlton Guest

    Remainder of Integer Division

    Can anyone tell me if there is a function to get just the remainder of an
    integer division in C#? Other languages have functions like DIV(x,y), etc.

    Thanks,

    James Knowlton



  2. #2
    WillyD Guest

    Re: Remainder of Integer Division

    Yes, there is, the modulus operator (%)
    f.i
    Console.WriteLine(-5 % 2);

    output -1

    Willy.


    "James Knowlton" <james.knowlton@impactinnovations.com> wrote in message
    news:3ad948af$1@news.devx.com...
    > Can anyone tell me if there is a function to get just the remainder of an
    > integer division in C#? Other languages have functions like DIV(x,y),

    etc.
    >
    > Thanks,
    >
    > James Knowlton
    >
    >




  3. #3
    James Knowlton Guest

    Re: Remainder of Integer Division

    Thanks for the info!

    James.
    "WillyD" <willy.denoyette@pandora.be> wrote in message
    news:3ad95c19$1@news.devx.com...
    > Yes, there is, the modulus operator (%)
    > f.i
    > Console.WriteLine(-5 % 2);
    >
    > output -1
    >
    > Willy.
    >
    >
    > "James Knowlton" <james.knowlton@impactinnovations.com> wrote in message
    > news:3ad948af$1@news.devx.com...
    > > Can anyone tell me if there is a function to get just the remainder of

    an
    > > integer division in C#? Other languages have functions like DIV(x,y),

    > etc.
    > >
    > > Thanks,
    > >
    > > James Knowlton
    > >
    > >

    >
    >




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links