Sign in Join
Wiki copytemporary

Percent sign/pt: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11%
22
33Em [[ASCII/pt|ASCII]], o caractere de código decimal `37` (ou [[Hexadecimal/pt|hexadecimal]] `25`) é definido como `%`.
44
55O símbolo `%` ("sinal de porcentagem") é utilizado em [[Pascal/pt|Pascal]]:
66
77- indica um [[Binary numeral system/pt|número/expressão no sistema numérico binário]].
88
99O sinal de porcentagem também aparece nas diretivas do Lazarus da forma `{%directive}`.
1010
1111## Exemplo
1212
1313``` pascal
1414
1515program digito_binario_simples;
1616
1717var b:byte;
1818begin
1919 b := %1010011;
2020 writeln (b);
2121 writeln (binStr(b,8));
2222 writeln ;
2323 writeln ('Tecle [Enter] para sair');
2424 readln;
2525end.
2626```
2727
2828Será impresso na saída algo como:
2929
30-`83`\
31-`01010011`\
32-` `\
33-`Tecle [Enter] para sair`
30+```text
31+83
32+01010011
33+
34+Tecle [Enter] para sair
35+```
3436
3537> **Note:** Literais de números binários não são suportados nos modos [[Mode Delphi/pt|{$mode Delphi}]] e [[Mode TP/pt|{$mode TP}]].
3638
3739## Ver também
3840
3941- `function` [[doc:rtl/system/binstr.html|binStr]] — Converte um *[[Integer/pt|Integer]]* (inteiro) para uma [[String/pt|String]] contendo a sua representação binária.
4042
4143---
4244*From the Free Pascal wiki, page "Percent sign/pt", as it stood on 2022-08-06 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history