From 2726862e22c6d90f70e215e49ccf2740fcf253a0 Mon Sep 17 00:00:00 2001 From: Ziqi Ma Date: Thu, 22 Oct 2020 19:26:09 -0700 Subject: [PATCH 1/2] update documentation-BigInt now supports binary and octal as well --- Specifications/Language/3_Expressions/ValueLiterals.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Specifications/Language/3_Expressions/ValueLiterals.md b/Specifications/Language/3_Expressions/ValueLiterals.md index 16a60de..5fb0b01 100644 --- a/Specifications/Language/3_Expressions/ValueLiterals.md +++ b/Specifications/Language/3_Expressions/ValueLiterals.md @@ -20,11 +20,13 @@ Value literals for the [`Int` type](https://github.com/microsoft/qsharp-language ## BigInt Literals -Value literals for the [`BigInt` type](https://github.com/microsoft/qsharp-language/tree/main/Specifications/Language/4_TypeSystem#available-types) are always postfixed with `L` and can be expressed in decimal or hexadecimal representation. Literals expressed in hexadecimal are prefixed with `0x`. There is no prefix for the commonly used decimal representation. +Value literals for the [`BigInt` type](https://github.com/microsoft/qsharp-language/tree/main/Specifications/Language/4_TypeSystem#available-types) are always postfixed with `L` and can be expressed in decimal, binary, octal or hexadecimal representation. Literals expressed in binary are prefixed with '0b', in octal prefixed with '0o', in hexadecimal prefixed with `0x`. There is no prefix for the commonly used decimal representation. | Representation | Value Literal | | --- | --- | | Decimal | `42L` | +| Binary | '0x101' | +| Octal | '0o345' | | Hexadecimal | `0x2aL` | ## Double Literals From f8362ac9f3054e9932e2f669a1abde81b7760a6a Mon Sep 17 00:00:00 2001 From: Ziqi Ma Date: Tue, 27 Oct 2020 18:56:52 -0700 Subject: [PATCH 2/2] make consistent with Int spec --- Specifications/Language/3_Expressions/ValueLiterals.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Specifications/Language/3_Expressions/ValueLiterals.md b/Specifications/Language/3_Expressions/ValueLiterals.md index 5fb0b01..10c073c 100644 --- a/Specifications/Language/3_Expressions/ValueLiterals.md +++ b/Specifications/Language/3_Expressions/ValueLiterals.md @@ -20,13 +20,13 @@ Value literals for the [`Int` type](https://github.com/microsoft/qsharp-language ## BigInt Literals -Value literals for the [`BigInt` type](https://github.com/microsoft/qsharp-language/tree/main/Specifications/Language/4_TypeSystem#available-types) are always postfixed with `L` and can be expressed in decimal, binary, octal or hexadecimal representation. Literals expressed in binary are prefixed with '0b', in octal prefixed with '0o', in hexadecimal prefixed with `0x`. There is no prefix for the commonly used decimal representation. +Value literals for the [`BigInt` type](https://github.com/microsoft/qsharp-language/tree/main/Specifications/Language/4_TypeSystem#available-types) are always postfixed with `L` and can be expressed in binary, octal, decimal, or hexadecimal representation. Literals expressed in binary are prefixed with `0b`, with `0o` for octal, and with `0x` for hexadecimal. There is no prefix for the commonly used decimal representation. | Representation | Value Literal | | --- | --- | +| Binary | `0b101010L` | +| Octal | `0o52L` | | Decimal | `42L` | -| Binary | '0x101' | -| Octal | '0o345' | | Hexadecimal | `0x2aL` | ## Double Literals