CINXE.COM

Laço infinito – Wikipédia, a enciclopédia livre

<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-toc-available" lang="pt" dir="ltr"> <head> <meta charset="UTF-8"> <title>Laço infinito – Wikipédia, a enciclopédia livre</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )ptwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":[",\t."," \t,"],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"dmy","wgMonthNames":["","janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],"wgRequestId":"23782ecc-7c8d-44df-9063-7e4a98eba379","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Laço_infinito","wgTitle":"Laço infinito","wgCurRevisionId":64555081,"wgRevisionId":64555081,"wgArticleId":1845494,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Programação"],"wgPageViewLanguage":"pt","wgPageContentLanguage":"pt","wgPageContentModel":"wikitext","wgRelevantPageName":"Laço_infinito","wgRelevantArticleId":1845494,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikipedia","wgCiteReferencePreviewsActive":false,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{ "pageLanguageCode":"pt","pageLanguageDir":"ltr","pageVariantFallbacks":"pt"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":true,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":3000,"wgRelatedArticlesCompat":[],"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q862372","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":true,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false,"wgSiteNoticeId":"2.30"};RLSTATE={"ext.gadget.FeedbackHighlight-base":"ready","ext.gadget.keepPDU":"ready","ext.globalCssJs.user.styles":"ready","site.styles":"ready", "user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.cite.styles":"ready","ext.pygments":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready","ext.dismissableSiteNotice.styles":"ready"};RLPAGEMODULES=["ext.cite.ux-enhancements","ext.pygments.view","site","mediawiki.page.ready","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.Topicon","ext.gadget.Metacaixa","ext.gadget.TitleRewrite","ext.gadget.ElementosOcultaveis","ext.gadget.FeedbackHighlight","ext.gadget.ReferenceTooltips","ext.gadget.NewVillagePump","ext.gadget.wikibugs","ext.gadget.charinsert","ext.gadget.requestForAdminship","ext.gadget.WikiMiniAtlas","ext.gadget.PagesForDeletion","ext.urlShortener.toolbar", "ext.centralauth.centralautologin","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","ext.cx.eventlogging.campaigns","ext.cx.uls.quick.actions","wikibase.client.vector-2022","ext.checkUser.clientHints","ext.growthExperiments.SuggestedEditSession","oojs-ui.styles.icons-media","oojs-ui-core.icons","wikibase.sidebar.tracking","ext.dismissableSiteNotice"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=pt&amp;modules=ext.cite.styles%7Cext.dismissableSiteNotice.styles%7Cext.pygments%2CwikimediaBadges%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&amp;only=styles&amp;skin=vector-2022"> <script async="" src="/w/load.php?lang=pt&amp;modules=startup&amp;only=scripts&amp;raw=1&amp;skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=pt&amp;modules=ext.gadget.FeedbackHighlight-base%2CkeepPDU&amp;only=styles&amp;skin=vector-2022"> <link rel="stylesheet" href="/w/load.php?lang=pt&amp;modules=site.styles&amp;only=styles&amp;skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Laço infinito – Wikipédia, a enciclopédia livre"> <meta property="og:type" content="website"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//pt.m.wikipedia.org/wiki/La%C3%A7o_infinito"> <link rel="alternate" type="application/x-wiki" title="Editar" href="/w/index.php?title=La%C3%A7o_infinito&amp;action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikipédia (pt)"> <link rel="EditURI" type="application/rsd+xml" href="//pt.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://pt.wikipedia.org/wiki/La%C3%A7o_infinito"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.pt"> <link rel="alternate" type="application/atom+xml" title="&#039;&#039;Feed&#039;&#039; Atom Wikipédia" href="/w/index.php?title=Especial:Mudan%C3%A7as_recentes&amp;feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-Laço_infinito rootpage-Laço_infinito skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Saltar para o conteúdo</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="&#039;&#039;Site&#039;&#039;"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Menu principal" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Menu principal</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Menu principal</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">mover para a barra lateral</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">ocultar</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navegação </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/Wikip%C3%A9dia:P%C3%A1gina_principal" title="Visitar a página principal [z]" accesskey="z"><span>Página principal</span></a></li><li id="n-featuredcontent" class="mw-list-item"><a href="/wiki/Portal:Conte%C3%BAdo_destacado"><span>Conteúdo destacado</span></a></li><li id="n-currentevents" class="mw-list-item"><a href="/wiki/Portal:Eventos_atuais" title="Informação temática sobre eventos atuais"><span>Eventos atuais</span></a></li><li id="n-villagepump" class="mw-list-item"><a href="/wiki/Wikip%C3%A9dia:Esplanada"><span>Esplanada</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Especial:Aleat%C3%B3ria" title="Carregar página aleatória [x]" accesskey="x"><span>Página aleatória</span></a></li><li id="n-portals" class="mw-list-item"><a href="/wiki/Portal:%C3%8Dndice"><span>Portais</span></a></li><li id="n-bug_in_article" class="mw-list-item"><a href="/wiki/Wikip%C3%A9dia:Informe_um_erro"><span>Informar um erro</span></a></li> </ul> </div> </div> <div id="p-interaction" class="vector-menu mw-portlet mw-portlet-interaction" > <div class="vector-menu-heading"> Colaboração </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-welcome" class="mw-list-item"><a href="/wiki/Wikip%C3%A9dia:Boas-vindas"><span>Boas-vindas</span></a></li><li id="n-help" class="mw-list-item"><a href="/wiki/Ajuda:P%C3%A1gina_principal" title="Um local reservado para auxílio."><span>Ajuda</span></a></li><li id="n-Páginas-de-testes-públicas" class="mw-list-item"><a href="/wiki/Ajuda:P%C3%A1gina_de_testes"><span>Páginas de testes públicas</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/Wikip%C3%A9dia:Portal_comunit%C3%A1rio" title="Sobre o projeto"><span>Portal comunitário</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Especial:Mudan%C3%A7as_recentes" title="Uma lista de mudanças recentes nesta wiki [r]" accesskey="r"><span>Mudanças recentes</span></a></li><li id="n-maintenance" class="mw-list-item"><a href="/wiki/Wikip%C3%A9dia:Manuten%C3%A7%C3%A3o"><span>Manutenção</span></a></li><li id="n-createpage" class="mw-list-item"><a href="/wiki/Ajuda:Guia_de_edi%C3%A7%C3%A3o/Como_come%C3%A7ar_uma_p%C3%A1gina"><span>Criar página</span></a></li><li id="n-newpages-description" class="mw-list-item"><a href="/wiki/Especial:P%C3%A1ginas_novas"><span>Páginas novas</span></a></li><li id="n-contact-description" class="mw-list-item"><a href="/wiki/Wikip%C3%A9dia:Contato"><span>Contato</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/Wikip%C3%A9dia:P%C3%A1gina_principal" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikipedia.png" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Wikipédia" src="/static/images/mobile/copyright/wikipedia-wordmark-fr.svg" style="width: 7.4375em; height: 1.125em;"> <img class="mw-logo-tagline" alt="" src="/static/images/mobile/copyright/wikipedia-tagline-pt.svg" width="120" height="13" style="width: 7.5em; height: 0.8125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Especial:Pesquisar" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Pesquisar na Wikipédia [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Busca</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Pesquisar na Wikipédia" aria-label="Pesquisar na Wikipédia" autocapitalize="sentences" title="Pesquisar na Wikipédia [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Especial:Pesquisar"> </div> <button class="cdx-button cdx-search-input__end-button">Pesquisar</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Ferramentas pessoais"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Aspeto"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page&#039;s font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Aspeto" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Aspeto</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=20120521SB001&amp;uselang=pt" class=""><span>Donativos</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Especial:Criar_conta&amp;returnto=La%C3%A7o+infinito" title="É encorajado a criar uma conta e iniciar sessão; no entanto, não é obrigatório" class=""><span>Criar uma conta</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Especial:Entrar&amp;returnto=La%C3%A7o+infinito" title="Aconselhamos-lhe a criar uma conta na Wikipédia, embora tal não seja obrigatório. [o]" accesskey="o" class=""><span>Entrar</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="Mais opções" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Ferramentas pessoais" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Ferramentas pessoais</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="Menu do utilizador" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=20120521SB001&amp;uselang=pt"><span>Donativos</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Especial:Criar_conta&amp;returnto=La%C3%A7o+infinito" title="É encorajado a criar uma conta e iniciar sessão; no entanto, não é obrigatório"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Criar uma conta</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Especial:Entrar&amp;returnto=La%C3%A7o+infinito" title="Aconselhamos-lhe a criar uma conta na Wikipédia, embora tal não seja obrigatório. [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Entrar</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Páginas para editores sem sessão iniciada <a href="/wiki/Ajuda:Introduction" aria-label="Saiba mais sobre edição"><span>saber mais</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Especial:Minhas_contribui%C3%A7%C3%B5es" title="Uma lista de edições feitas a partir deste endereço IP [y]" accesskey="y"><span>Contribuições</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Especial:Minha_discuss%C3%A3o" title="Discussão sobre edições feitas a partir deste endereço IP [n]" accesskey="n"><span>Discussão</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><div id="mw-dismissablenotice-anonplace"></div><script>(function(){var node=document.getElementById("mw-dismissablenotice-anonplace");if(node){node.outerHTML="\u003Cdiv class=\"mw-dismissable-notice\"\u003E\u003Cdiv class=\"mw-dismissable-notice-close\"\u003E[\u003Ca tabindex=\"0\" role=\"button\"\u003Eocultar\u003C/a\u003E]\u003C/div\u003E\u003Cdiv class=\"mw-dismissable-notice-body\"\u003E\u003C!-- CentralNotice --\u003E\u003Cdiv id=\"localNotice\" data-nosnippet=\"\"\u003E\u003Cdiv class=\"anonnotice\" lang=\"pt\" dir=\"ltr\"\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E";}}());</script></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="&#039;&#039;Site&#039;&#039;"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Conteúdo" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Conteúdo</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">mover para a barra lateral</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">ocultar</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">Início</div> </a> </li> <li id="toc-Recursividade_infinita" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Recursividade_infinita"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Recursividade infinita</span> </div> </a> <ul id="toc-Recursividade_infinita-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Referências" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Referências"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Referências</span> </div> </a> <ul id="toc-Referências-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Ver_também" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Ver_também"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Ver também</span> </div> </a> <ul id="toc-Ver_também-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Conteúdo" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Alternar o índice" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Alternar o índice</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Laço infinito</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="Ir para um artigo noutra língua. Disponível em 27 línguas" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-27" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">27 línguas</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-ar mw-list-item"><a href="https://ar.wikipedia.org/wiki/%D8%AD%D9%84%D9%82%D8%A9_%D9%84%D8%A7%D9%85%D8%AA%D9%86%D8%A7%D9%87%D9%8A%D8%A9" title="حلقة لامتناهية — árabe" lang="ar" hreflang="ar" data-title="حلقة لامتناهية" data-language-autonym="العربية" data-language-local-name="árabe" class="interlanguage-link-target"><span>العربية</span></a></li><li class="interlanguage-link interwiki-az mw-list-item"><a href="https://az.wikipedia.org/wiki/Sonsuz_d%C3%B6vr" title="Sonsuz dövr — azerbaijano" lang="az" hreflang="az" data-title="Sonsuz dövr" data-language-autonym="Azərbaycanca" data-language-local-name="azerbaijano" class="interlanguage-link-target"><span>Azərbaycanca</span></a></li><li class="interlanguage-link interwiki-ca mw-list-item"><a href="https://ca.wikipedia.org/wiki/Bucle_infinit" title="Bucle infinit — catalão" lang="ca" hreflang="ca" data-title="Bucle infinit" data-language-autonym="Català" data-language-local-name="catalão" class="interlanguage-link-target"><span>Català</span></a></li><li class="interlanguage-link interwiki-cs mw-list-item"><a href="https://cs.wikipedia.org/wiki/Nekone%C4%8Dn%C3%BD_cyklus" title="Nekonečný cyklus — checo" lang="cs" hreflang="cs" data-title="Nekonečný cyklus" data-language-autonym="Čeština" data-language-local-name="checo" class="interlanguage-link-target"><span>Čeština</span></a></li><li class="interlanguage-link interwiki-da mw-list-item"><a href="https://da.wikipedia.org/wiki/Uendelig_l%C3%B8kke" title="Uendelig løkke — dinamarquês" lang="da" hreflang="da" data-title="Uendelig løkke" data-language-autonym="Dansk" data-language-local-name="dinamarquês" class="interlanguage-link-target"><span>Dansk</span></a></li><li class="interlanguage-link interwiki-de mw-list-item"><a href="https://de.wikipedia.org/wiki/Endlosschleife_(Programmierung)" title="Endlosschleife (Programmierung) — alemão" lang="de" hreflang="de" data-title="Endlosschleife (Programmierung)" data-language-autonym="Deutsch" data-language-local-name="alemão" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-en mw-list-item"><a href="https://en.wikipedia.org/wiki/Infinite_loop" title="Infinite loop — inglês" lang="en" hreflang="en" data-title="Infinite loop" data-language-autonym="English" data-language-local-name="inglês" class="interlanguage-link-target"><span>English</span></a></li><li class="interlanguage-link interwiki-es mw-list-item"><a href="https://es.wikipedia.org/wiki/Bucle_infinito" title="Bucle infinito — espanhol" lang="es" hreflang="es" data-title="Bucle infinito" data-language-autonym="Español" data-language-local-name="espanhol" class="interlanguage-link-target"><span>Español</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikipedia.org/wiki/%D8%AD%D9%84%D9%82%D9%87_%D8%A8%DB%8C%E2%80%8C%D9%86%D9%87%D8%A7%DB%8C%D8%AA" title="حلقه بی‌نهایت — persa" lang="fa" hreflang="fa" data-title="حلقه بی‌نهایت" data-language-autonym="فارسی" data-language-local-name="persa" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-fi mw-list-item"><a href="https://fi.wikipedia.org/wiki/Ikuinen_silmukka" title="Ikuinen silmukka — finlandês" lang="fi" hreflang="fi" data-title="Ikuinen silmukka" data-language-autonym="Suomi" data-language-local-name="finlandês" class="interlanguage-link-target"><span>Suomi</span></a></li><li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://fr.wikipedia.org/wiki/Boucle_infinie" title="Boucle infinie — francês" lang="fr" hreflang="fr" data-title="Boucle infinie" data-language-autonym="Français" data-language-local-name="francês" class="interlanguage-link-target"><span>Français</span></a></li><li class="interlanguage-link interwiki-id mw-list-item"><a href="https://id.wikipedia.org/wiki/Perulangan_takterhingga" title="Perulangan takterhingga — indonésio" lang="id" hreflang="id" data-title="Perulangan takterhingga" data-language-autonym="Bahasa Indonesia" data-language-local-name="indonésio" class="interlanguage-link-target"><span>Bahasa Indonesia</span></a></li><li class="interlanguage-link interwiki-it mw-list-item"><a href="https://it.wikipedia.org/wiki/Loop_infinito" title="Loop infinito — italiano" lang="it" hreflang="it" data-title="Loop infinito" data-language-autonym="Italiano" data-language-local-name="italiano" class="interlanguage-link-target"><span>Italiano</span></a></li><li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://ja.wikipedia.org/wiki/%E7%84%A1%E9%99%90%E3%83%AB%E3%83%BC%E3%83%97" title="無限ループ — japonês" lang="ja" hreflang="ja" data-title="無限ループ" data-language-autonym="日本語" data-language-local-name="japonês" class="interlanguage-link-target"><span>日本語</span></a></li><li class="interlanguage-link interwiki-kk mw-list-item"><a href="https://kk.wikipedia.org/wiki/%D0%A6%D0%B8%D0%BA%D0%BB%D0%B4%D0%B5%D0%BD%D1%83" title="Циклдену — cazaque" lang="kk" hreflang="kk" data-title="Циклдену" data-language-autonym="Қазақша" data-language-local-name="cazaque" class="interlanguage-link-target"><span>Қазақша</span></a></li><li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://ko.wikipedia.org/wiki/%EB%AC%B4%ED%95%9C_%EB%A3%A8%ED%94%84" title="무한 루프 — coreano" lang="ko" hreflang="ko" data-title="무한 루프" data-language-autonym="한국어" data-language-local-name="coreano" class="interlanguage-link-target"><span>한국어</span></a></li><li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://nl.wikipedia.org/wiki/Oneindige_lus" title="Oneindige lus — neerlandês" lang="nl" hreflang="nl" data-title="Oneindige lus" data-language-autonym="Nederlands" data-language-local-name="neerlandês" class="interlanguage-link-target"><span>Nederlands</span></a></li><li class="interlanguage-link interwiki-pl mw-list-item"><a href="https://pl.wikipedia.org/wiki/P%C4%99tla_niesko%C5%84czona" title="Pętla nieskończona — polaco" lang="pl" hreflang="pl" data-title="Pętla nieskończona" data-language-autonym="Polski" data-language-local-name="polaco" class="interlanguage-link-target"><span>Polski</span></a></li><li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://ru.wikipedia.org/wiki/%D0%91%D0%B5%D1%81%D0%BA%D0%BE%D0%BD%D0%B5%D1%87%D0%BD%D1%8B%D0%B9_%D1%86%D0%B8%D0%BA%D0%BB" title="Бесконечный цикл — russo" lang="ru" hreflang="ru" data-title="Бесконечный цикл" data-language-autonym="Русский" data-language-local-name="russo" class="interlanguage-link-target"><span>Русский</span></a></li><li class="interlanguage-link interwiki-sh mw-list-item"><a href="https://sh.wikipedia.org/wiki/Beskona%C4%8Dna_petlja" title="Beskonačna petlja — servo-croata" lang="sh" hreflang="sh" data-title="Beskonačna petlja" data-language-autonym="Srpskohrvatski / српскохрватски" data-language-local-name="servo-croata" class="interlanguage-link-target"><span>Srpskohrvatski / српскохрватски</span></a></li><li class="interlanguage-link interwiki-sr mw-list-item"><a href="https://sr.wikipedia.org/wiki/%D0%91%D0%B5%D1%81%D0%BA%D0%BE%D0%BD%D0%B0%D1%87%D0%BD%D0%B0_%D0%BF%D0%B5%D1%82%D1%99%D0%B0" title="Бесконачна петља — sérvio" lang="sr" hreflang="sr" data-title="Бесконачна петља" data-language-autonym="Српски / srpski" data-language-local-name="sérvio" class="interlanguage-link-target"><span>Српски / srpski</span></a></li><li class="interlanguage-link interwiki-sv mw-list-item"><a href="https://sv.wikipedia.org/wiki/O%C3%A4ndlig_slinga" title="Oändlig slinga — sueco" lang="sv" hreflang="sv" data-title="Oändlig slinga" data-language-autonym="Svenska" data-language-local-name="sueco" class="interlanguage-link-target"><span>Svenska</span></a></li><li class="interlanguage-link interwiki-tr mw-list-item"><a href="https://tr.wikipedia.org/wiki/Sonsuz_d%C3%B6ng%C3%BC_(Bilgisayar)" title="Sonsuz döngü (Bilgisayar) — turco" lang="tr" hreflang="tr" data-title="Sonsuz döngü (Bilgisayar)" data-language-autonym="Türkçe" data-language-local-name="turco" class="interlanguage-link-target"><span>Türkçe</span></a></li><li class="interlanguage-link interwiki-uk mw-list-item"><a href="https://uk.wikipedia.org/wiki/%D0%9D%D0%B5%D1%81%D0%BA%D1%96%D0%BD%D1%87%D0%B5%D0%BD%D0%BD%D0%B8%D0%B9_%D1%86%D0%B8%D0%BA%D0%BB" title="Нескінченний цикл — ucraniano" lang="uk" hreflang="uk" data-title="Нескінченний цикл" data-language-autonym="Українська" data-language-local-name="ucraniano" class="interlanguage-link-target"><span>Українська</span></a></li><li class="interlanguage-link interwiki-vi mw-list-item"><a href="https://vi.wikipedia.org/wiki/V%C3%B2ng_l%E1%BA%B7p_v%C3%B4_h%E1%BA%A1n" title="Vòng lặp vô hạn — vietnamita" lang="vi" hreflang="vi" data-title="Vòng lặp vô hạn" data-language-autonym="Tiếng Việt" data-language-local-name="vietnamita" class="interlanguage-link-target"><span>Tiếng Việt</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/%E7%84%A1%E7%AA%AE%E8%BF%B4%E5%9C%88" title="無窮迴圈 — chinês" lang="zh" hreflang="zh" data-title="無窮迴圈" data-language-autonym="中文" data-language-local-name="chinês" class="interlanguage-link-target"><span>中文</span></a></li><li class="interlanguage-link interwiki-zh-yue mw-list-item"><a href="https://zh-yue.wikipedia.org/wiki/%E7%84%A1%E9%99%90%E8%BF%B4%E5%9C%88" title="無限迴圈 — cantonês" lang="yue" hreflang="yue" data-title="無限迴圈" data-language-autonym="粵語" data-language-local-name="cantonês" class="interlanguage-link-target"><span>粵語</span></a></li> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q862372#sitelinks-wikipedia" title="Editar hiperligações interlínguas" class="wbc-editpage">Editar hiperligações</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Espaços nominais"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-main" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/La%C3%A7o_infinito" title="Ver a página de conteúdo [c]" accesskey="c"><span>Artigo</span></a></li><li id="ca-talk" class="new vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Discuss%C3%A3o:La%C3%A7o_infinito&amp;action=edit&amp;redlink=1" rel="discussion" class="new" title="Discussão sobre o conteúdo da página (página não existe) [t]" accesskey="t"><span>Discussão</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Mudar a variante da língua" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">português</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Vistas"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/La%C3%A7o_infinito"><span>Ler</span></a></li><li id="ca-ve-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=La%C3%A7o_infinito&amp;veaction=edit" title="Editar esta página [v]" accesskey="v"><span>Editar</span></a></li><li id="ca-edit" class="collapsible vector-tab-noicon mw-list-item"><a href="/w/index.php?title=La%C3%A7o_infinito&amp;action=edit" title="Editar o código-fonte desta página [e]" accesskey="e"><span>Editar código-fonte</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=La%C3%A7o_infinito&amp;action=history" title="Edições anteriores desta página. [h]" accesskey="h"><span>Ver histórico</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Ferramentas de página"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Ferramentas" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Ferramentas</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Ferramentas</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">mover para a barra lateral</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">ocultar</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="Mais opções" > <div class="vector-menu-heading"> Operações </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/La%C3%A7o_infinito"><span>Ler</span></a></li><li id="ca-more-ve-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=La%C3%A7o_infinito&amp;veaction=edit" title="Editar esta página [v]" accesskey="v"><span>Editar</span></a></li><li id="ca-more-edit" class="collapsible vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=La%C3%A7o_infinito&amp;action=edit" title="Editar o código-fonte desta página [e]" accesskey="e"><span>Editar código-fonte</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=La%C3%A7o_infinito&amp;action=history"><span>Ver histórico</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> Geral </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Especial:P%C3%A1ginas_afluentes/La%C3%A7o_infinito" title="Lista de todas as páginas que contêm hiperligações para esta [j]" accesskey="j"><span>Páginas afluentes</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Especial:Altera%C3%A7%C3%B5es_relacionadas/La%C3%A7o_infinito" rel="nofollow" title="Mudanças recentes nas páginas para as quais esta contém hiperligações [k]" accesskey="k"><span>Alterações relacionadas</span></a></li><li id="t-upload" class="mw-list-item"><a href="/wiki/Wikipedia:Carregar_ficheiro" title="Carregar ficheiros [u]" accesskey="u"><span>Carregar ficheiro</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Especial:P%C3%A1ginas_especiais" title="Lista de páginas especiais [q]" accesskey="q"><span>Páginas especiais</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=La%C3%A7o_infinito&amp;oldid=64555081" title="Hiperligação permanente para esta revisão desta página"><span>Hiperligação permanente</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=La%C3%A7o_infinito&amp;action=info" title="Mais informações sobre esta página"><span>Informações da página</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=Especial:Citar&amp;page=La%C3%A7o_infinito&amp;id=64555081&amp;wpFormIdentifier=titleform" title="Informação sobre como citar esta página"><span>Citar esta página</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Especial:UrlShortener&amp;url=https%3A%2F%2Fpt.wikipedia.org%2Fwiki%2FLa%25C3%25A7o_infinito"><span>Obter URL encurtado</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Especial:QrCode&amp;url=https%3A%2F%2Fpt.wikipedia.org%2Fwiki%2FLa%25C3%25A7o_infinito"><span>Descarregar código QR</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Imprimir/exportar </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="/w/index.php?title=Especial:Livro&amp;bookcmd=book_creator&amp;referer=La%C3%A7o+infinito"><span>Criar um livro</span></a></li><li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Especial:DownloadAsPdf&amp;page=La%C3%A7o_infinito&amp;action=show-download-screen"><span>Descarregar como PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=La%C3%A7o_infinito&amp;printable=yes" title="Versão para impressão desta página [p]" accesskey="p"><span>Versão para impressão</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> Noutros projetos </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q862372" title="Hiperligação para o elemento do repositório de dados [g]" accesskey="g"><span>Elemento Wikidata</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Ferramentas de página"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Aspeto"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Aspeto</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">mover para a barra lateral</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">ocultar</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> </div> <div id="siteSub" class="noprint">Origem: Wikipédia, a enciclopédia livre.</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="pt" dir="ltr"><p>Um <b>laço infinito</b> é uma sequência de instruções em um <a href="/wiki/Programa_de_computador" title="Programa de computador">programa de computador</a> que <a href="/wiki/Estrutura_de_repeti%C3%A7%C3%A3o" title="Estrutura de repetição">repete</a> infinitamente, ou porque não há condição de parada ou porque a condição existe mas nunca é atingida. Em antigos <a href="/wiki/Sistema_operacional" class="mw-redirect" title="Sistema operacional">sistemas operacionais</a> com <a href="/wiki/Multitarefa_cooperativa" title="Multitarefa cooperativa">multitarefa cooperativa</a>, laços infinitos normalmente bloqueavam todo o sistema. Com o modelo atual de multitarefa <a href="/wiki/Preemptividade" title="Preemptividade">preemptiva</a>, laços infinitos resultam no consumo máximo do tempo do processador, mas o processo geralmente pode ser terminado pelo utilizador. <a href="/wiki/Espera_ativa" title="Espera ativa">Espera ativa</a> é confundida com laços infinitos. Uma causa possível do travamento dum computador é um laço infinito, e outras causas incluem <i><a href="/wiki/Deadlock" title="Deadlock">deadlocks</a></i> e <a href="/wiki/Falha_de_segmenta%C3%A7%C3%A3o" title="Falha de segmentação">falhas de segmentação</a>.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span>[</span>1<span>]</span></a></sup><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span>[</span>2<span>]</span></a></sup> </p><p>Há diversas situações em que o laço infinito é um comportamento esperado. Por exemplo, diversos programas <a href="/wiki/Cliente-servidor" class="mw-redirect" title="Cliente-servidor">servidores</a> repetem infinitamente, esperando uma requisição, tratando a requisição, e voltando a esperar outra requisição. Chamado <a href="/wiki/La%C3%A7o_de_eventos" title="Laço de eventos">laço de eventos</a>, esse tipo de construção não é considerado um laço infinito no sentido estrito do termo, pois o término manual do programa serve como condição válida de parada. O termo "laço infinito" é geralmente usado quando esse efeito não é o resultado esperado, isto é, quando há um <a href="/wiki/Defeito_de_software" class="mw-redirect" title="Defeito de software">defeito</a>. </p><p>Ainda que a maioria dos laços infinitos possam ser encontrados numa revisão detalhada do código, não há método genérico para determinar se um dado programa terminará ou será executado infinitamente, fruto da inabilidade de <a href="/wiki/Problema_de_decis%C3%A3o" title="Problema de decisão">decisão</a> do <a href="/wiki/Problema_da_parada" title="Problema da parada">problema da parada</a>. </p> <div class="mw-heading mw-heading2"><h2 id="Recursividade_infinita">Recursividade infinita</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=La%C3%A7o_infinito&amp;veaction=edit&amp;section=1" title="Editar secção: Recursividade infinita" class="mw-editsection-visualeditor"><span>editar</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=La%C3%A7o_infinito&amp;action=edit&amp;section=1" title="Editar código-fonte da secção: Recursividade infinita"><span>editar código-fonte</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>A recursividade infinita é um caso especial de laço infinito causado por <a href="/wiki/Recursividade_(ci%C3%AAncia_da_computa%C3%A7%C3%A3o)" title="Recursividade (ciência da computação)">recursividade</a>. Assim como num laço de repetição, a recursividade também depende duma condição de parada, que nunca é atingida na recursividade infinita. Nesse caso, a recursividade continua até o <a href="/wiki/Estouro_de_pilha" class="mw-redirect" title="Estouro de pilha">estouro de pilha</a> do sistema. Um exemplo trivial é o termo Ω no <a href="/wiki/C%C3%A1lculo_Lambda" class="mw-redirect" title="Cálculo Lambda">cálculo Lambda</a>, demonstrado abaixo em <a href="/wiki/Scheme" title="Scheme">Scheme</a>: </p> <div class="mw-highlight mw-highlight-lang-scheme mw-content-ltr" dir="ltr"><pre><span></span><span class="p">(</span><span class="k">define</span><span class="w"> </span><span class="nv">Ω</span> <span class="w"> </span><span class="p">(</span><span class="k">let</span><span class="w"> </span><span class="p">([</span><span class="nv">ω</span><span class="w"> </span><span class="p">(</span><span class="k">lambda</span><span class="w"> </span><span class="p">(</span><span class="nf">f</span><span class="p">)</span><span class="w"> </span><span class="p">(</span><span class="nf">f</span><span class="w"> </span><span class="nv">f</span><span class="p">))])</span> <span class="w"> </span><span class="p">(</span><span class="nf">ω</span><span class="w"> </span><span class="nv">ω</span><span class="p">)))</span> </pre></div><h2 id="Referências" style="cursor: help;" title="Esta seção foi configurada para não ser editável diretamente. Edite a página toda ou a seção anterior em vez disso."><span id="Refer.C3.AAncias"></span>Referências</h2> <div class="reflist" style="list-style-type: decimal;"><div class="mw-references-wrap"><ol class="references"> <li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="https://www.yourdictionary.com/endless-loop">«Endless loop dictionary definition»</a><span class="reference-accessdate">. Consultado em 22 de janeiro de 2020</span>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20200801213748/https://www.yourdictionary.com/endless-loop">Cópia arquivada em 1 de agosto de 2020</a></cite><span title="ctx_ver=Z39.88-2004&amp;rfr_id=info%3Asid%2Fpt.wikipedia.org%3ALa%C3%A7o+infinito&amp;rft.btitle=Endless+loop+dictionary+definition&amp;rft.genre=unknown&amp;rft_id=https%3A%2F%2Fwww.yourdictionary.com%2Fendless-loop&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook" class="Z3988"><span style="display:none;">&#160;</span></span></span> </li> <li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="https://whatis.techtarget.com/definition/infinite-loop-endless-loop">«What is infinite loop (endless loop)»</a><span class="reference-accessdate">. Consultado em 22 de janeiro de 2020</span>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20190715101446/https://whatis.techtarget.com/definition/infinite-loop-endless-loop">Cópia arquivada em 15 de julho de 2019</a></cite><span title="ctx_ver=Z39.88-2004&amp;rfr_id=info%3Asid%2Fpt.wikipedia.org%3ALa%C3%A7o+infinito&amp;rft.btitle=What+is+infinite+loop+%28endless+loop%29&amp;rft.genre=unknown&amp;rft_id=https%3A%2F%2Fwhatis.techtarget.com%2Fdefinition%2Finfinite-loop-endless-loop&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook" class="Z3988"><span style="display:none;">&#160;</span></span></span> </li> </ol></div></div> <div class="mw-heading mw-heading2"><h2 id="Ver_também"><span id="Ver_tamb.C3.A9m"></span>Ver também</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=La%C3%A7o_infinito&amp;veaction=edit&amp;section=2" title="Editar secção: Ver também" class="mw-editsection-visualeditor"><span>editar</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=La%C3%A7o_infinito&amp;action=edit&amp;section=2" title="Editar código-fonte da secção: Ver também"><span>editar código-fonte</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/La%C3%A7o_(programa%C3%A7%C3%A3o)" class="mw-redirect" title="Laço (programação)">Laço (programação)</a></li> <li><a href="/wiki/Goto" class="mw-disambig" title="Goto">Goto</a></li> <li><a href="/wiki/Recursividade_(ci%C3%AAncia_da_computa%C3%A7%C3%A3o)" title="Recursividade (ciência da computação)">Recursividade</a></li> <li><i><a href="/wiki/Deadlock" title="Deadlock">Deadlock</a></i></li> <li><a href="/wiki/Algoritmo_busca-ciclos_de_Floyd" title="Algoritmo busca-ciclos de Floyd">Algoritmo busca-ciclos de Floyd</a></li></ul> <!-- NewPP limit report Parsed by mw‐web.eqiad.main‐5dc468848‐994pc Cached time: 20241124110037 Cache expiry: 2592000 Reduced expiry: false Complications: [] CPU time usage: 0.064 seconds Real time usage: 0.173 seconds Preprocessor visited node count: 144/1000000 Post‐expand include size: 3442/2097152 bytes Template argument size: 14/2097152 bytes Highest expansion depth: 7/100 Expensive parser function count: 1/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 3177/5000000 bytes Lua time usage: 0.026/10.000 seconds Lua memory usage: 1439863/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 60.076 1 Predefinição:Referências 100.00% 60.076 1 -total 84.72% 50.898 2 Predefinição:Citar_web 3.50% 2.104 1 Predefinição:Esconder_link_para_editar_seção --> <!-- Saved in parser cache with key ptwiki:pcache:idhash:1845494-0!canonical and timestamp 20241124110037 and revision id 64555081. Rendering was triggered because: page-view --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Obtida de "<a dir="ltr" href="https://pt.wikipedia.org/w/index.php?title=Laço_infinito&amp;oldid=64555081">https://pt.wikipedia.org/w/index.php?title=Laço_infinito&amp;oldid=64555081</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Especial:Categorias" title="Especial:Categorias">Categoria</a>: <ul><li><a href="/wiki/Categoria:Programa%C3%A7%C3%A3o" title="Categoria:Programação">Programação</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> Esta página foi editada pela última vez às 18h30min de 12 de outubro de 2022.</li> <li id="footer-info-copyright">Este texto é disponibilizado nos termos da licença <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.pt">Atribuição-CompartilhaIgual 4.0 Internacional (CC BY-SA 4.0) da Creative Commons</a>; pode estar sujeito a condições adicionais. Para mais detalhes, consulte as <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">condições de utilização</a>.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy/pt-br">Política de privacidade</a></li> <li id="footer-places-about"><a href="/wiki/Wikip%C3%A9dia:Sobre">Sobre a Wikipédia</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikip%C3%A9dia:Aviso_geral">Avisos gerais</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Código de conduta</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Programadores</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/pt.wikipedia.org">Estatísticas</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Declaração sobre ''cookies''</a></li> <li id="footer-places-mobileview"><a href="//pt.m.wikipedia.org/w/index.php?title=La%C3%A7o_infinito&amp;mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Versão móvel</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-f69cdc8f6-49vgg","wgBackendResponseTime":156,"wgPageParseReport":{"limitreport":{"cputime":"0.064","walltime":"0.173","ppvisitednodes":{"value":144,"limit":1000000},"postexpandincludesize":{"value":3442,"limit":2097152},"templateargumentsize":{"value":14,"limit":2097152},"expansiondepth":{"value":7,"limit":100},"expensivefunctioncount":{"value":1,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":3177,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 60.076 1 Predefinição:Referências","100.00% 60.076 1 -total"," 84.72% 50.898 2 Predefinição:Citar_web"," 3.50% 2.104 1 Predefinição:Esconder_link_para_editar_seção"]},"scribunto":{"limitreport-timeusage":{"value":"0.026","limit":"10.000"},"limitreport-memusage":{"value":1439863,"limit":52428800}},"cachereport":{"origin":"mw-web.eqiad.main-5dc468848-994pc","timestamp":"20241124110037","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"La\u00e7o infinito","url":"https:\/\/pt.wikipedia.org\/wiki\/La%C3%A7o_infinito","sameAs":"http:\/\/www.wikidata.org\/entity\/Q862372","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q862372","author":{"@type":"Organization","name":"Contribuidores dos projetos da Wikimedia"},"publisher":{"@type":"Organization","name":"Funda\u00e7\u00e3o Wikimedia, Inc.","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2008-07-10T00:56:45Z","dateModified":"2022-10-12T18:30:58Z"}</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10