473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Range syntax

I'm looking through the C++ standard and see statements like this:

yields: the smallest q in
[p,p+n) such that
X::eq(*q,c) is true, zero
otherwise.

I'm not from a scientific/math background but would like to read more
about what this "[p,p+n)" syntax is called and how it's defined so
does anyone have a link to a web page about this please?

Regards,

Pete
Oct 16 '08 #1
6 2506
On Thu, 16 Oct 2008 08:33:29 -0700, newbarker wrote:
I'm looking through the C++ standard and see statements like this:

yields: the smallest q in
[p,p+n) such that
X::eq(*q,c) is true, zero
otherwise.

I'm not from a scientific/math background but would like to read more
about what this "[p,p+n)" syntax is called and how it's defined so does
anyone have a link to a web page about this please?

Regards,

Pete
http://en.wikipedia.org/wiki/Interval_(mathematics)

--
OU
Remember 18th of June 2008, Democracy died that afternoon.
http://frapedia.se/wiki/Information_in_English
Oct 16 '08 #2
ne*******@gmail.com wrote:
I'm not from a scientific/math background but would like to read more
about what this "[p,p+n)" syntax is called and how it's defined so
does anyone have a link to a web page about this please?
The notation of ranges is rather simple: Square brackets are used when
the extreme values are included in the range, and parentheses when they
are excluded. They can also be mixed, as in your example.

"[p, p+n)" means a range of values between p and p+n, including p but
excluding p+n.

In theory you could also have (p, p+n] which would mean a range of
values between p and p+n, excluding p but including p+n. Of course this
is seldom used when talking about C++.
Oct 16 '08 #3
ne*******@gmail.com wrote:
I'm looking through the C++ standard and see statements like this:

yields: the smallest q in
[p,p+n) such that
X::eq(*q,c) is true, zero
otherwise.

I'm not from a scientific/math background but would like to read more
about what this "[p,p+n)" syntax is called and how it's defined so
does anyone have a link to a web page about this please?
I don't have a link, but this is a standard Western math notation for a
range that begins at 'p' *inclusively* and ends on 'p+n' but excludes
that value.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 16 '08 #4
Many thanks to all that responded!
Oct 16 '08 #5
On Oct 16, 5:33 pm, newbar...@gmail.com wrote:
I'm looking through the C++ standard and see statements like this:
yields: the smallest q in
[p,p+n) such that
X::eq(*q,c) is true, zero
otherwise.
I'm not from a scientific/math background but would like to
read more about what this "[p,p+n)" syntax is called and how
it's defined so does anyone have a link to a web page about
this please?
Victor and Juha have already given the details, but it's worth
mentionning that this is called a half open interval---an
interval which includes its end points is closed, one which
doesn't is open. Also, the notation varies: "[a,b)" (or
"[a...b)") is almost universal in the anglo-saxon world, but in
France, I've often seen "[a;b[" or "[a...b[", with the [] being
used backwards to indicate openness. (Note too the use of ';'
instead of ','. This is usual in much of the world, where the
decimal character is a comma, and not a point.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Oct 17 '08 #6
James Kanze wrote:
On Oct 16, 5:33 pm, newbar...@gmail.com wrote:
>I'm looking through the C++ standard and see statements like this:
>yields: the smallest q in
[p,p+n) such that
X::eq(*q,c) is true, zero
otherwise.
>I'm not from a scientific/math background but would like to
read more about what this "[p,p+n)" syntax is called and how
it's defined so does anyone have a link to a web page about
this please?

Victor and Juha have already given the details, but it's worth
mentionning that this is called a half open interval---an
interval which includes its end points is closed, one which
doesn't is open. Also, the notation varies: "[a,b)" (or
"[a...b)") is almost universal in the anglo-saxon world, but in
France, I've often seen "[a;b[" or "[a...b[", with the [] being
used backwards to indicate openness. (Note too the use of ';'
instead of ','. This is usual in much of the world, where the
decimal character is a comma, and not a point.)
The use of the inverted bracket to indicate the open end of the interval
is common in former Soviet Union as well. At least I was taught that
way... And while the comma *is* the decimal separator, I don't recall
the use of the semicolon in the interval.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 17 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Maksim Kasimov | last post by:
there are few of a time periods, for example: 2005-06-08 12:30 -> 2005-06-10 15:30, 2005-06-12 12:30 -> 2005-06-14 15:30 and there is some date and time value: 2005-06-11 12:30 what is the...
3
by: George | last post by:
Sub ExcelToListBox() Dim xRange As Object Dim ary Dim xValue As String xRange = oXL.Range("A1:A9") 'has letters A-H ary = xRange.value xValue = ary(3, 1) 'xValue = C...
5
by: Chris | last post by:
Hey all. Anyone who is familiar with Python programming knows that you can have code like this: list = This code puts all the items processed by the for loop in a list plus 1. Is there a way...
2
by: Colin J. Williams | last post by:
One of the little irritants of Python is that the range syntax is rather long-winded: >>range(3, 20, 6) >>> It would be nice if one could have something like 3:20:6. I've just come across...
85
by: Russ | last post by:
Every Python programmer gets this message occasionally: IndexError: list index out of range The message tells you where the error occurred, but it doesn't tell you what the range and the...
2
by: red vertigo | last post by:
Hi All, I am trying to write a basic stored procedure to return a range of values but admit that I am stumped. The procedure syntax used is: ALTER PROCEDURE Rpt_LegacyPurchaseOrderSp( ...
17
by: stdazi | last post by:
Hello! Many times I was suggested to use xrange and range instead of the while constructs, and indeed, they are quite more elegant - but, after calculating the overhead (and losen flexibility)...
4
by: Michal Bozon | last post by:
many Python newcomers are confused why range(10), does not include 10. If there was a proposal for the new syntax for ranges, which is known e.g. from Pascal or Ruby... ....is there a...
3
by: notnorwegian | last post by:
' '.join() anyone can tell me what im doing wrong?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.