Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

* Programming 1 (BI)
  ◇ exercises
  ◇ quick link

teaching assets


Félévek

* 2024/25/2
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* Scala


[ edit | logout ]
[ sandbox | passwd ]

Integer overflow

(1) overflow
#include <limits.h>
#include <stdio.h>

int main()
{
    int a = INT_MAX;
    printf("%d\n", a); // 2147483647

    ++a;
    printf("%d\n", a); // -2147483648

    return 0;
}
import std.stdio;

void main()
{
    int a = int.max;
    writeln(a); // 2147483647

    ++a;
    writeln(a); // -2147483648
}

Detecting overflow

It's possible to detect overflow. Use the core.checkedint module.

TODO: add example

Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2025 June 22, 07:54