Questions tagged [number-literal]

9 questions
80
votes
4 answers

Why does {. . . .0} evaluate to {}?

I just found {....0} in friend's code. Evaluating it in console returns {} (empty object). Why is that? What is the meaning of 4 dots in JavaScript?
Mist
  • 913
  • 6
  • 11
9
votes
2 answers

What is the full list of number suffixes in PowerShell?

What is the full list of suffixes you can use on PowerShell number literals? So far I have found: ╔════════╦═════════╦════════════════════════╗ ║ Suffix ║ Example ║ Result ║ ╠════════╬═════════╬════════════════════════╣ ║ L ║ …
Andrey Shchekin
  • 21,101
  • 19
  • 94
  • 162
5
votes
3 answers

Coding conventions for number literal suffix?

I did some googleling, but was unable to find a solution to my question. Are there generally accepted java coding conventions according to double and float declaration? What syntax is recommended by those guidelines? Double d = 1d; …
L.Butz
  • 2,466
  • 25
  • 44
2
votes
1 answer

Why the literal "-9223372036854775808" (min 64 bit signed integer) is not accepted by kotlin?

I'm trying to write a fast json parser for JVM in kotlin. And I found this issue, I'm not sure this is a bug or any good reason behind this. val x: Long = -9223372036854775808L // compile error
damphat
  • 18,246
  • 8
  • 45
  • 59
2
votes
1 answer

Numeric literals prepended with `0`

Using insert, I push values to an Array as: myarray=[22,33,44] myarray.insert(0,02) # => [2,22,33,44] If do the following, I get: myarray.insert(0,020) # => [16,2,22,33,44] 020 becomes 16? If I do the following, I get: myarray.insert(0,0200) # =>…
user1884495
2
votes
1 answer

Do any SQL systems use commas as decimal points in numeric literals?

From what I can ascertain, most SQL implementations insist on a '.' decimal point in numeric literals. Do any use a ',' instead? (ie. as used by many European countries), or can the '.' be assumed? The specific situation I have, has .NET/ADO.NET…
winwaed
  • 7,645
  • 6
  • 36
  • 81
2
votes
3 answers

Determine the Kind (int, float) of Number a Python numeric literal represents?

In case anyone is interested, this is a followup to Regular expression to match a Python integer literal. The tokenize module is useful for breaking apart a Python expression, but tokenize.NUMBER is not very expressive, as it represents all kinds…
asmeurer
  • 86,894
  • 26
  • 169
  • 240
1
vote
1 answer

number 622.08E6 interpretation in C

I recently came across a C code (working by the way) where I found freq_xtal = ((622.08E6 * vcxo_reg_val->hiv * vcxo_reg_val->n1)/(temp_rfreq)); From my intuition it seems that 622.08E6 should mean 622.08 x 10^6. Is this assumption correct? I tried…
liv2hak
  • 14,472
  • 53
  • 157
  • 270
0
votes
1 answer

Unusual variable type mismatches

If I run the command: Resize-VHD -ComputerName $VMhost -Path "D:\VMs\$VMname\Virtual Hard Disks\$vmname.vhdx" -SizeBytes 70GB Powershell is clever enough to understand what 70GB is, accept the arguement and will resize the drive, However, if I do…
FrankU32
  • 311
  • 1
  • 3
  • 18