Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8532157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:38:58+00:00 2026-06-11T09:38:58+00:00

According to the Scala documentation for the method Range.end , it returns the exclusive

  • 0

According to the Scala documentation for the method Range.end, it returns “the exclusive end of the range.” So why does it return the same value for both the to and the until notations? For example:

Welcome to Scala version 2.9.2 (Java HotSpot(TM) Server VM, Java 1.7.0).
Type in expressions to have them evaluated.
Type :help for more information.

scala> (1 to 10).end
res0: Int = 10

scala> (1 until 10).end
res1: Int = 10

Shouldn’t res0 == 11?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:38:59+00:00Added an answer on June 11, 2026 at 9:38 am

    to and until result in related but different Range classes: Range.Inclusive and Range, respectively; Range.Inclusive IS-A Range.

    • isInclusive will distinguish between the two class types.

    • end, or the upper bound, is interpreted in the context of the range being exclusive or inclusive. The upper bound is the second number provided in the range specification, which was 10 in both of the sample cases in the original question. And yes, this “upper bound” may be less than the “lower bound”, if the range goes from high to low (i.e. 1 until -10).

    • last will return the last value in the range, which may be what you were trying to obtain from end.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to PHP.net manual, pg_pconnect will create a persistent connection, or will return the
According to Hibernate documentation : After observing that arrays cannot be lazy , you
I'm trying to generate a list in scala according to the formula: for n
According to http://www.assembla.com/wiki/show/scala-ide/Troubleshooting in order to have the Scala Eclipse plugin to work with
In Chapter 9 of Programming In Scala, there is an example method like this:
According to scaladoc, sliding() returns... An iterator producing iterable collections of size size ,
According to Programming in Scala one can pass the argument -Xprint:typer to the compiler
according to this post and from OpenCV documentation, I can initialize and access each
According to this question , Scala's type system is Turing complete . What resources
According to Scaladoc, there is no method named map in Array class, but there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.