usepackage("amsmath"); import graph; size(8cm,0); real Floor(real x) {return floor(x);} pair[] ListeDesPointsCompris; pair[] ListeDesPointsExclus; //================== // bool3 est un booléen à trois états : true, default et false bool3 TestRelierOuPas(real x) { static real lasty; static bool first = true; real y = floor(x); bool memebranche = first || lasty == y; first = false; if(!memebranche) { ListeDesPointsExclus.push((x,lasty)); ListeDesPointsCompris.push((x,y)); } lasty=y; return memebranche ? true : default; }; //================== draw(graph(Floor,-5.5,5.5,500,TestRelierOuPas)); axes("$x$",rotate(0)*"$\lfloor x\rfloor$",red); dot(ListeDesPointsCompris); dot(ListeDesPointsExclus,UnFill);