Difference between revisions of "Percent sign/pt"

From Lazarus wiki
Jump to navigationJump to search
Line 3: Line 3:
 
<div style="float:right; margin: 0 25px 20px 0; padding:40px; font-size:500%; font-family: Georgia; background-color: #f9f9f9; border: 2px solid #777777;">%</div>
 
<div style="float:right; margin: 0 25px 20px 0; padding:40px; font-size:500%; font-family: Georgia; background-color: #f9f9f9; border: 2px solid #777777;">%</div>
  
Em [[ASCII/pt|ASCII]], o caractere de código decimal <syntaxhighlight lang="pascal" enclose="none">37</syntaxhighlight> (ou [[Hexadecimal/pt|hexadecimal]] <syntaxhighlight lang="pascal" enclose="none">25</syntaxhighlight>) é definido para ser <syntaxhighlight lang="pascal" enclose="none">%</syntaxhighlight>.
+
Em [[ASCII/pt|ASCII]], o caractere de código decimal <syntaxhighlight lang="pascal" enclose="none">37</syntaxhighlight> (ou [[Hexadecimal/pt|hexadecimal]] <syntaxhighlight lang="pascal" enclose="none">25</syntaxhighlight>) é definido como <syntaxhighlight lang="pascal" enclose="none">%</syntaxhighlight>.
  
 
O símbolo <syntaxhighlight lang="pascal" enclose="none">%</syntaxhighlight> ("sinal de porcentagem") é utilizado em [[Pascal/pt|Pascal]]:
 
O símbolo <syntaxhighlight lang="pascal" enclose="none">%</syntaxhighlight> ("sinal de porcentagem") é utilizado em [[Pascal/pt|Pascal]]:

Revision as of 14:01, 26 September 2019

English (en) suomi (fi) français (fr) português (pt) русский (ru)

%

Em ASCII, o caractere de código decimal 37 (ou hexadecimal 25) é definido como %.

O símbolo % ("sinal de porcentagem") é utilizado em Pascal:

O sinal de porcentagem também aparece nas diretivas do Lazarus da forma {%directive}.

Exemplo

program digito_binario_simples;

var b:byte;
begin
  b := %1010011;
  writeln (b);
  writeln (binStr(b,8));
  writeln ;
  writeln ('Tecle [Enter] para sair');
  readln;
end.

Será impresso na saída algo como:

83
01010011
 
Tecle [Enter] para sair
Light bulb  Nota: Literais de número binário não são suportados nos modos {$mode Delphi} e {$mode TP}.

Ver também

  • function binStr — Converte um Integer (inteiro) para uma String contendo a sua representação binária.